Skip to content

mohamedalysayed/SplashFOAM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SplashFOAM

A modular GUI for streamlined CFD workflows across all OpenFOAM versions.

SplashFOAM-Sep2024

TOC

Overview

SplashFOAM is a modular GUI for the Computational Fluid Dynamics (CFD) code OpenFOAM. The main impetus behind building SplashFOAM has been to increase the efficiency of CFD production, remove unnecessary friction, and allow engineers to focus on the physics of the problem rather than coding syntax.

Unlike other tools, SplashFOAM is not confined to a specific OpenFOAM release. It handles all OpenFOAM versions, whether ESI or Foundation versions, making it both forward and backward-compatible. This flexibility ensures that users can switch between different OpenFOAM versions without any hassle, maintaining a streamlined workflow across different projects. SplashFOAM aims to be a dynamic, intuitive, and efficient pre-processor, streamlining the setup and execution of OpenFOAM simulations.

Installation

To get started with SplashFOAM, follow the steps below:

Pre-Installation Script

SplashFOAM includes a pre-installation script to ensure your system is ready:

  • Automated Dependency Installation: The script checks for required packages and installs them if missing, including OpenFOAM, FreeCAD, Gmsh, and more.
  • WSL Compatibility: Special considerations for users running SplashFOAM on Windows Subsystem for Linux (WSL), including setting up display configurations.

Whether you are running Ubuntu natively, through VirtualBox, or WSL, you must execute the Ubuntu_MEL.sh script before launching SplashFOAM.

Currently, SplashFOAM is supported on Ubuntu (recommended to run on 22.04.5 LTS).

Step-by-Step Instructions

  • Step 1: Clone the Repository

    Clone the SplashFOAM repository to your local machine by running:

    git clone https://github.com/mohamedalysayed/Splash-OpenFOAM.git 
    
  • Step 2: Switch to the Correct Branch

    From the cloned code, navigate to the SplashFOAM/Resources/Build_Splash/ directory.

    cd SplashFOAM/Resources/Build_Splash/
    
    
  • Step 3: Install Necessary Packages

    Run the run_PreInstaller.sh script to install all the necessary dependencies:

    chmod +x run_PreInstaller.sh
    ./run_PreInstaller.sh
    
  • Ensure you have Zenity installed. If not, execute the command below:

    sudo apt-get install -y zenity

Screenshot from 2024-12-28 01-11-48

This will ensure that all required packages are installed. If needed, the user can install other secondary packages from the suggested list.

  • Step 4: Launch SplashFOAM

    After installing the necessary packages, navigate to the Sources directory and launch SplashFOAM using Python 3:

    cd ../../Sources/
    python3 SplashFOAM.py
    

Configuration Management

Easily manage configuration files for different versions of OpenFOAM:

  • Automatic Detection of Installed OpenFOAM Versions: SplashFOAM identifies available versions on your system and sets up the necessary environment variables.
  • Alias Setup: Aliases for various OpenFOAM versions are added to the bashrc during installation (according to the user's choice), ensuring easy access to different versions.

Features

Geometry Import

SplashFOAM allows users to import geometry files from various formats, including:

  • STL (stereolithography)
  • OBJ (Wavefront object)
  • STEP (Standard for the exchange of product data - analytical format)

Import Geometry enables the user to view their CAD in one of five options:

  • Splash Viewer: A local program built into SplashFOAM for quick and efficient CAD visualization.
  • FreeCAD: Open your geometries directly in FreeCAD for further design modifications.
  • Gmsh: Utilize Gmsh for meshing or geometry inspection.
  • Blender: Seamlessly load your CAD files into Blender.
  • ParaView: Use ParaView to visualize and inspect complex CAD models.

CAD-Viewers

image Screenshot from 2024-10-23 23-36-41

Meshing Tools

SplashFOAM offers a range of meshing capabilities:

Mesh Types

Currently, SplashFOAM supports three types of meshes:

  • Cartesian: Generate structured hex-dominant meshes.
  • Polyhedral: Create meshes with polyhedral elements that benefit complex geometries.
  • Tetrahedral: Flexible tetrahedral meshing for various applications.

When creating a mesh from scratch, these meshes are generated using cfMesh. Additionally, SplashFOAM handles cases with SnappyHexMesh scripts, making it versatile in handling different meshing setups.

Refinement Regions

Splash Mesher offers the option to add refinement objects to the domain. As shown below, by defining the type of refinement object and the number of objects you can add the corresponding block to the background meshing script then you’ll be asked to provide the relevant info for the chosen type. Once done and mesh is created, Splash will automatically remove the refinement object assignment to avoid accumulating unwanted blocks in the underlying meshDict (or any equivalent) script.

  • Step 1: From Mesh Controls, click on Add Refinement Objects

Screenshot from 2024-11-13 03-23-41

  • Step 2: Choose the refinement objects type and number of repetitions (if any)

Screenshot from 2024-11-15 09-11-41

  • Step 3: Populate the parameters relevant to that object and click add

Screenshot from 2024-11-13 03-24-59

  • Step 4: Create the mesh and review the changes in Paraview

Screenshot from 2024-11-13 03-27-19

Case Creator

SplashFOAM’s Case Creator streamlines the generation of OpenFOAM cases for both internal and external flow scenarios. Accessible from the main window under File > Create Case, this tool now comes with enhanced functionality and visualization capabilities:

  • Built-In VTK Viewer: The Case Creator integrates a VTK-based geometry viewer, allowing users to:
  • Visualize imported geometries with real-time rendering.
  • Build and display a bounding box around the geometry to verify domain boundaries.
  • Define probes (mesh points) at critical locations for debugging problematic cases.
  • Enhanced Workflow: Quickly create cases with intuitive tools to set up boundary conditions, fluid properties, and simulation parameters, with a focus on efficiency and accuracy.
  • Guided Input Assistance: Case Creator provides a guided interface to ensure that input files are correctly set up for various OpenFOAM solvers, minimizing the risk of configuration errors.

image

Simulation Setup

SplashFOAM simplifies the setup of OpenFOAM cases by providing:

  • Case Directory Management: Seamlessly load, configure, and organize case directories.
  • Mesh Refinement Levels: Users can specify refinement levels for different regions to improve mesh quality and resolution.
  • Physical Properties: Easily define physical properties for the simulation, with the option to select from pre-saved fluid property profiles for common fluids.
  • Turbulence Models: Choose from a wide range of turbulence models tailored to specific flow regimes.
  • Numerical Schemes: Define numerical schemes for discretization and solution accuracy directly in the GUI.
  • Boundary Conditions: Seamlessly configure boundary conditions through a guided interface.
  • Simulation Controls:
    • Start and end time of the simulation.
    • Time-stepping configurations.
    • Solution reports to monitor progress and convergence.
    • Function objects for calculating derived quantities and other post-processing tasks.
  • Initialization and Execution: Directly initialize and run simulations from within the SplashFOAM environment. These set the simulation to its initial state and set up the necessary parameters to launch the case. Note: SplashFOAM does not allow direct changes in boundary condition (BC) files. If BC changes are needed, users may set up the case in Case Creator and then load the case again in SplashFOAM for further processing.

Run Simulation

SplashFOAM can launch a simulation locally or on a remote HPC cluster (Cloud HPC):

  • Local Execution: Run your simulations directly on your local machine.
  • Remote Execution: Configure SplashFOAM to submit jobs to a remote HPC environment for more computational power. More information on setting up remote HPC access can be found here.

image

Post-Processing

SplashFOAM integrates with popular post-processing tools to streamline analysis:

  • ParaView: Currently, results can be analyzed using the visualization tool Paraview. Users can launch ParaView directly from the main SplashFOAM window to post-process simulation results.

  • Grace: Quick access to plot simulation results in 2D using Xmgrace.

    Screenshot from 2023-10-31 17-05-51

    Grace-Example

Splash Cloud

Splash-Cloud is an innovative web-based application currently under development to bring CFD workflows to your browser. Designed to complement SplashFOAM, this tool enables users to interact with their geometries directly online, offering an intuitive way to inspect, modify, and prepare geometries for simulation and exports seamless OpenFOAM cases.

SplashCloud-ii SplashCloud-i

Key Features

  • Browser-Based Geometry Manipulation: Load, rotate, scale, and inspect geometries (STL, OBJ, STEP) right from your web browser.
  • Advanced 3D Rendering: Experience glossy, interactive 3D rendering for geometries in formats like STL, OBJ, and STEP, with seamless camera control and enhanced lighting for precision inspections.
  • Seamless Integration with SplashFOAM: Prepare OpenFOAM-ready cases effortlessly, as Splash-Cloud outputs configurations that are fully compatible with SplashFOAM.
  • No Installation Required: Accessible on any device with an internet connection—eliminating setup hassle.
  • Collaboration Made Easy: Share geometries and configurations in real-time with teammates.

Documentation

The manual is currently under development. In the meantime, please check the repository for updates or contact the CFD Dose community for help.

Code Developers

Feedback

Feel free to contribute to SplashFOAM by submitting issues or feature suggestions. Your feedback is super valuable here ;)

CFD Dose Album*

[*Please refer to this GitHub repository when using any of the images below (proper referencing is required)]

  • Motorbike OpenFOAM Case - Steady State

Screenshot from 2024-09-27 07-33-48

motorbike5

  • Grid wall distance of a 90-degree-bend geometry

Screenshot from 2024-08-08 23-59-18

  • Velocity distribution in a 90-degree-bend at Re=4080

Screenshot from 2024-10-03 22-10-34

  • Instantaneous velocity and particle distribution at a cross-section of a rectangular channel at shear Re=150

641234f5f0f60e00ad86359e_Streamwise_fvel_yz_vel_vectorfield_10e5part_St15_Re150_ts_490k_Vinkovic_comparison