From 86844de91c13df012eaf57e8f6ab5fb8680d3979 Mon Sep 17 00:00:00 2001 From: David Landa Marban Date: Fri, 16 Feb 2024 18:32:03 +0100 Subject: [PATCH] Updating to OpenFOAM 11 --- README.md | 19 +++++--- requirements.txt | 1 + src/pymm/core/pymm.py | 26 ++++++----- .../templates/OpenFOAM/flowStokes/0/U.mako | 11 +++-- .../templates/OpenFOAM/flowStokes/0/p.mako | 11 +++-- .../constant/momentumTransport.mako | 20 +++++++++ .../constant/physicalProperties.mako | 21 +++++++++ .../constant/transportProperties.mako | 21 --------- .../constant/turbulenceProperties.mako | 21 --------- .../flowStokes/system/controlDict.mako | 15 ++++--- .../OpenFOAM/flowStokes/system/fvSchemes.mako | 11 +++-- .../flowStokes/system/fvSolution.mako | 11 +++-- .../OpenFOAM/tracerTransport/0/T.mako | 16 +++---- .../{fvOptions.mako => fvConstraints.mako} | 11 ++--- .../constant/momentumTransport.mako | 20 +++++++++ .../constant/physicalProperties.mako | 21 +++++++++ .../constant/transportProperties.mako | 20 --------- .../OpenFOAM/tracerTransport/inlet.mako | 6 --- .../tracerTransport/system/controlDict.mako | 26 +++++++---- .../tracerTransport/system/fvSchemes.mako | 12 ++--- .../tracerTransport/system/fvSolution.mako | 15 ++++--- .../tracerTransport/system/topoSetDict.mako | 45 +++++++++++++++++++ 22 files changed, 229 insertions(+), 151 deletions(-) create mode 100644 src/pymm/templates/OpenFOAM/flowStokes/constant/momentumTransport.mako create mode 100644 src/pymm/templates/OpenFOAM/flowStokes/constant/physicalProperties.mako delete mode 100644 src/pymm/templates/OpenFOAM/flowStokes/constant/transportProperties.mako delete mode 100644 src/pymm/templates/OpenFOAM/flowStokes/constant/turbulenceProperties.mako rename src/pymm/templates/OpenFOAM/tracerTransport/constant/{fvOptions.mako => fvConstraints.mako} (90%) create mode 100644 src/pymm/templates/OpenFOAM/tracerTransport/constant/momentumTransport.mako create mode 100644 src/pymm/templates/OpenFOAM/tracerTransport/constant/physicalProperties.mako delete mode 100644 src/pymm/templates/OpenFOAM/tracerTransport/constant/transportProperties.mako delete mode 100644 src/pymm/templates/OpenFOAM/tracerTransport/inlet.mako create mode 100644 src/pymm/templates/OpenFOAM/tracerTransport/system/topoSetDict.mako diff --git a/README.md b/README.md index f39b8d3..0e20120 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,10 @@ This repository provides a workflow to perform computational fluid dynamics (CFD ## Installation You will first need to install -* OpenFOAM (https://www.openfoam.com) (tested with OpenFOAM v2206) -* Gmsh (https://gmsh.info) (tested with Gmsh 4.11.0) - -You will also need to install some python packages, see ```requirements.txt``` for a complete list. You can install all the required python packages in a virtual environment with the following commands: +* OpenFOAM (https://www.openfoam.com) (tested with OpenFOAM-11) +* Gmsh (https://gmsh.info) (tested with Gmsh 4.8.4) +You will also need to install some Python packages, see ```requirements.txt``` for a complete list. You can install all the required Python packages in a virtual environment with the following commands: ```bash # Clone the repo git clone https://github.com/daavid00/pymm.git @@ -33,6 +32,16 @@ pip install -e . # For contributions/testing/linting, install the dev-requirements pip install -r dev-requirements.txt ``` +Depending on the location where OpenFOAM is installed, then before running pymm (inside the vpymm Python environment), you need to enter the OpenFoam environment: +```bash +# Check where openFOAM is installed +echo $WM_PROJECT_DIR +# The return value was /opt/openfoam11, then we activate the environment +source /opt/openfoam11/etc/bashrc +# Then, if everything went fine, typing +gmshToFoam +# should print the argument flags for that OpenFOAM executable. +``` ## Running pymm You can run _pymm_ as a single command line: @@ -48,7 +57,7 @@ See the [_documentation_](https://daavid00.github.io/pymm/introduction.html). The following is a list of journal papers in which _pymm_ is used: 1. Liu, N., Haugen, M., Benali, B., Landa-Marbán, D., Fernø, M.A., 2023. Pore-scale spatiotemporal dynamics of microbial-induced calcium carbonate growth and distribution in porous media. Int. J. Greenh. Gas Control 125, 103885. https://doi.org/10.1016/j.ijggc.2023.103885 -1. Liu, N., Haugen, M., Benali, B., Landa-Marbán, D., Fernø, M.A., 2023. Pore-scale kinetics of calcium dissolution and secondary precipitation during geological carbon storage. Chem. Geol., to appear. +1. Liu, N., Haugen, M., Benali, B., Landa-Marbán, D., Fernø, M.A., 2023. Pore-scale kinetics of calcium dissolution and secondary precipitation during geological carbon storage. Chem. Geol. 641, 121782. https://doi.org/10.1016/j.chemgeo.2023.121782. ## About pymm The image-based Python package for computational fluid dynamics pymm is funded by [_Center for Sustainable Subsurface Resources_](https://cssr.no) [project no. 331841] and [_NORCE Norwegian Research Centre As_](https://www.norceresearch.no) [project number 101070]. diff --git a/requirements.txt b/requirements.txt index c3d7bd6..a9e2928 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ porespy +pypardiso mako \ No newline at end of file diff --git a/src/pymm/core/pymm.py b/src/pymm/core/pymm.py index 077aec0..af94431 100644 --- a/src/pymm/core/pymm.py +++ b/src/pymm/core/pymm.py @@ -1,4 +1,5 @@ """Main script""" + import os import csv import glob @@ -540,8 +541,8 @@ def run_stokes(dic): for file in [ "0/p", "0/U", - "constant/transportProperties", - "constant/turbulenceProperties", + "constant/physicalProperties", + "constant/momentumTransport", "system/controlDict", "system/fvSchemes", "system/fvSolution", @@ -564,7 +565,7 @@ def run_stokes(dic): with open("constant/polyMesh/boundary", "r", encoding="utf8") as file: dic["boundary"] = file.readlines() - dic["boundary"][22] = "type empty;" + dic["boundary"][20] = "type empty;" mytemplate = Template(filename=f"{dic['pat']}/templates/utils/boundary.mako") var = {"dic": dic} filled_template = mytemplate.render(**var) @@ -573,7 +574,7 @@ def run_stokes(dic): os.system(f"rm -rf {dic['cwd']}/{dic['fol']}/VTK_flowStokes") # Running the steady-state flow simulation - os.system("simpleFoam & wait") + os.system("foamRun -solver incompressibleFluid & wait") os.system("foamToVTK & wait") os.system(f"mkdir {dic['cwd']}/{dic['fol']}/VTK_flowStokes") os.system(f"cp -r VTK/* {dic['cwd']}/{dic['fol']}/VTK_flowStokes") @@ -596,11 +597,12 @@ def run_tracer(dic): os.system(f"mkdir {dic['cwd']}/{dic['fol']}/OpenFOAM/tracerTransport/system") var = {"dic": dic} for file in [ - "inlet", "0/T", - "constant/transportProperties", - "constant/fvOptions", + "constant/physicalProperties", + "constant/momentumTransport", + "constant/fvConstraints", "system/controlDict", + "system/topoSetDict", "system/fvSchemes", "system/fvSolution", ]: @@ -621,15 +623,19 @@ def run_tracer(dic): os.system( f"cp {latest_folder}U {dic['cwd']}/{dic['fol']}/OpenFOAM/tracerTransport/0/" ) + os.system( + f"cp {latest_folder}p {dic['cwd']}/{dic['fol']}/OpenFOAM/tracerTransport/0/" + ) os.system( f"cp -r {dic['cwd']}/{dic['fol']}/OpenFOAM/flowStokes/constant/polyMesh " f"{dic['cwd']}/{dic['fol']}/OpenFOAM/tracerTransport/constant/" ) os.chdir(f"{dic['cwd']}/{dic['fol']}/OpenFOAM/tracerTransport") - os.system("setSet -batch inlet & wait") + os.system("topoSet & wait") # Running the simulation of tracer transport - os.system("scalarTransportFoam & wait") + os.system("foamRun & wait") + # exit() os.system("foamToVTK & wait") os.system(f"cp -r VTK/* {dic['cwd']}/{dic['fol']}/VTK_tracerTransport") @@ -650,7 +656,7 @@ def main(): # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# ad-wa is distributed in the hope that it will be useful, +# pymm is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. diff --git a/src/pymm/templates/OpenFOAM/flowStokes/0/U.mako b/src/pymm/templates/OpenFOAM/flowStokes/0/U.mako index 0394bdf..ecbb7d6 100644 --- a/src/pymm/templates/OpenFOAM/flowStokes/0/U.mako +++ b/src/pymm/templates/OpenFOAM/flowStokes/0/U.mako @@ -1,13 +1,12 @@ /*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2206 | -| \\ / A nd | Website: www.openfoam.com | -| \\/ M anipulation | | + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 11 + \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { - version 2.0; format ascii; class volVectorField; object U; diff --git a/src/pymm/templates/OpenFOAM/flowStokes/0/p.mako b/src/pymm/templates/OpenFOAM/flowStokes/0/p.mako index eb747e5..be219f4 100644 --- a/src/pymm/templates/OpenFOAM/flowStokes/0/p.mako +++ b/src/pymm/templates/OpenFOAM/flowStokes/0/p.mako @@ -1,13 +1,12 @@ /*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2206 | -| \\ / A nd | Website: www.openfoam.com | -| \\/ M anipulation | | + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 11 + \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { - version 2.0; format ascii; class volScalarField; object p; diff --git a/src/pymm/templates/OpenFOAM/flowStokes/constant/momentumTransport.mako b/src/pymm/templates/OpenFOAM/flowStokes/constant/momentumTransport.mako new file mode 100644 index 0000000..fa1552f --- /dev/null +++ b/src/pymm/templates/OpenFOAM/flowStokes/constant/momentumTransport.mako @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 11 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object momentumTransport; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + + +// ************************************************************************* // diff --git a/src/pymm/templates/OpenFOAM/flowStokes/constant/physicalProperties.mako b/src/pymm/templates/OpenFOAM/flowStokes/constant/physicalProperties.mako new file mode 100644 index 0000000..6f37fda --- /dev/null +++ b/src/pymm/templates/OpenFOAM/flowStokes/constant/physicalProperties.mako @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 11 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object physicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +viscosityModel constant; + +nu [0 2 -1 0 0 0 0] ${dic['nu']}; + +// ************************************************************************* // diff --git a/src/pymm/templates/OpenFOAM/flowStokes/constant/transportProperties.mako b/src/pymm/templates/OpenFOAM/flowStokes/constant/transportProperties.mako deleted file mode 100644 index 4c6a3e6..0000000 --- a/src/pymm/templates/OpenFOAM/flowStokes/constant/transportProperties.mako +++ /dev/null @@ -1,21 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2206 | -| \\ / A nd | Website: www.openfoam.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - object transportProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -transportModel Newtonian; - -nu [0 2 -1 0 0 0 0] ${dic['nu']}; - -// ************************************************************************* // diff --git a/src/pymm/templates/OpenFOAM/flowStokes/constant/turbulenceProperties.mako b/src/pymm/templates/OpenFOAM/flowStokes/constant/turbulenceProperties.mako deleted file mode 100644 index c08e4b0..0000000 --- a/src/pymm/templates/OpenFOAM/flowStokes/constant/turbulenceProperties.mako +++ /dev/null @@ -1,21 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 4.1 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object turbulenceProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -simulationType laminar; - - -// ************************************************************************* // diff --git a/src/pymm/templates/OpenFOAM/flowStokes/system/controlDict.mako b/src/pymm/templates/OpenFOAM/flowStokes/system/controlDict.mako index 9332709..a94d7dc 100644 --- a/src/pymm/templates/OpenFOAM/flowStokes/system/controlDict.mako +++ b/src/pymm/templates/OpenFOAM/flowStokes/system/controlDict.mako @@ -1,13 +1,12 @@ /*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 4.1 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 11 + \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { - version 2.0; format ascii; class dictionary; location "system"; @@ -15,7 +14,9 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -application simpleFoam; +application foamRun; + +solver incompressibleFluid; startFrom startTime; diff --git a/src/pymm/templates/OpenFOAM/flowStokes/system/fvSchemes.mako b/src/pymm/templates/OpenFOAM/flowStokes/system/fvSchemes.mako index 4a38f44..c4594a1 100644 --- a/src/pymm/templates/OpenFOAM/flowStokes/system/fvSchemes.mako +++ b/src/pymm/templates/OpenFOAM/flowStokes/system/fvSchemes.mako @@ -1,13 +1,12 @@ /*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 4.1 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 11 + \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { - version 2.0; format ascii; class dictionary; location "system"; diff --git a/src/pymm/templates/OpenFOAM/flowStokes/system/fvSolution.mako b/src/pymm/templates/OpenFOAM/flowStokes/system/fvSolution.mako index ae23fe7..58551e3 100644 --- a/src/pymm/templates/OpenFOAM/flowStokes/system/fvSolution.mako +++ b/src/pymm/templates/OpenFOAM/flowStokes/system/fvSolution.mako @@ -1,13 +1,12 @@ /*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 4.1 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 11 + \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { - version 2.0; format ascii; class dictionary; location "system"; diff --git a/src/pymm/templates/OpenFOAM/tracerTransport/0/T.mako b/src/pymm/templates/OpenFOAM/tracerTransport/0/T.mako index bd6188f..f8c7e28 100644 --- a/src/pymm/templates/OpenFOAM/tracerTransport/0/T.mako +++ b/src/pymm/templates/OpenFOAM/tracerTransport/0/T.mako @@ -1,20 +1,19 @@ /*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2206 | -| \\ / A nd | Website: www.openfoam.com | -| \\/ M anipulation | | + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 11 + \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { - version 2.0; format ascii; class volScalarField; object T; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 0 0 0 0 0 0]; +dimensions [0 0 0 1 0 0 0]; internalField uniform 0; @@ -26,7 +25,8 @@ boundaryField } inlet { - type zeroGradient; + type fixedValue; + value uniform 1; } outlet { diff --git a/src/pymm/templates/OpenFOAM/tracerTransport/constant/fvOptions.mako b/src/pymm/templates/OpenFOAM/tracerTransport/constant/fvConstraints.mako similarity index 90% rename from src/pymm/templates/OpenFOAM/tracerTransport/constant/fvOptions.mako rename to src/pymm/templates/OpenFOAM/tracerTransport/constant/fvConstraints.mako index f993c59..5700449 100644 --- a/src/pymm/templates/OpenFOAM/tracerTransport/constant/fvOptions.mako +++ b/src/pymm/templates/OpenFOAM/tracerTransport/constant/fvConstraints.mako @@ -16,16 +16,11 @@ FoamFile fixedTemperature { - type scalarFixedValueConstraint; - + type fixedTemperatureConstraint; + mode uniform; selectionMode cellZone; cellZone c0Zone; - fieldValues - { - T 1.0; - } - - + temperature 1.0; } diff --git a/src/pymm/templates/OpenFOAM/tracerTransport/constant/momentumTransport.mako b/src/pymm/templates/OpenFOAM/tracerTransport/constant/momentumTransport.mako new file mode 100644 index 0000000..fa1552f --- /dev/null +++ b/src/pymm/templates/OpenFOAM/tracerTransport/constant/momentumTransport.mako @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 11 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object momentumTransport; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + + +// ************************************************************************* // diff --git a/src/pymm/templates/OpenFOAM/tracerTransport/constant/physicalProperties.mako b/src/pymm/templates/OpenFOAM/tracerTransport/constant/physicalProperties.mako new file mode 100644 index 0000000..6f37fda --- /dev/null +++ b/src/pymm/templates/OpenFOAM/tracerTransport/constant/physicalProperties.mako @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 11 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object physicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +viscosityModel constant; + +nu [0 2 -1 0 0 0 0] ${dic['nu']}; + +// ************************************************************************* // diff --git a/src/pymm/templates/OpenFOAM/tracerTransport/constant/transportProperties.mako b/src/pymm/templates/OpenFOAM/tracerTransport/constant/transportProperties.mako deleted file mode 100644 index 96459f5..0000000 --- a/src/pymm/templates/OpenFOAM/tracerTransport/constant/transportProperties.mako +++ /dev/null @@ -1,20 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2206 | -| \\ / A nd | Website: www.openfoam.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - object transportProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -DT [0 2 -1 0 0 0 0] ${dic['D']}; - - -// ************************************************************************* // diff --git a/src/pymm/templates/OpenFOAM/tracerTransport/inlet.mako b/src/pymm/templates/OpenFOAM/tracerTransport/inlet.mako deleted file mode 100644 index c6bb707..0000000 --- a/src/pymm/templates/OpenFOAM/tracerTransport/inlet.mako +++ /dev/null @@ -1,6 +0,0 @@ -from curses.panel import top_panel - - -faceSet f0 new patchToFace inlet -cellSet c0 new faceToCell f0 any -cellZoneSet c0Zone new setToCellZone c0 \ No newline at end of file diff --git a/src/pymm/templates/OpenFOAM/tracerTransport/system/controlDict.mako b/src/pymm/templates/OpenFOAM/tracerTransport/system/controlDict.mako index 02968c7..e8c67f5 100644 --- a/src/pymm/templates/OpenFOAM/tracerTransport/system/controlDict.mako +++ b/src/pymm/templates/OpenFOAM/tracerTransport/system/controlDict.mako @@ -1,25 +1,31 @@ /*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2206 | -| \\ / A nd | Website: www.openfoam.com | -| \\/ M anipulation | | + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 11 + \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { - version 2.0; format ascii; class dictionary; + location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -application scalarTransportFoam; +application foamRun; -startFrom startTime; +solver functions; + +subSolver incompressibleFluid; + +startFrom latestTime; startTime 0; +subSolverTime 0; + stopAt endTime; endTime ${dic['t_et']}; @@ -44,5 +50,9 @@ timePrecision 6; runTimeModifiable true; +functions +{ + #includeFunc scalarTransport(T, diffusivity=constant, D = ${dic['D']}) +} // ************************************************************************* // diff --git a/src/pymm/templates/OpenFOAM/tracerTransport/system/fvSchemes.mako b/src/pymm/templates/OpenFOAM/tracerTransport/system/fvSchemes.mako index 0c23bc9..4e93d5d 100644 --- a/src/pymm/templates/OpenFOAM/tracerTransport/system/fvSchemes.mako +++ b/src/pymm/templates/OpenFOAM/tracerTransport/system/fvSchemes.mako @@ -1,15 +1,15 @@ /*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2206 | -| \\ / A nd | Website: www.openfoam.com | -| \\/ M anipulation | | + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 11 + \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { - version 2.0; format ascii; class dictionary; + location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/pymm/templates/OpenFOAM/tracerTransport/system/fvSolution.mako b/src/pymm/templates/OpenFOAM/tracerTransport/system/fvSolution.mako index 5f3cafb..9d455c0 100644 --- a/src/pymm/templates/OpenFOAM/tracerTransport/system/fvSolution.mako +++ b/src/pymm/templates/OpenFOAM/tracerTransport/system/fvSolution.mako @@ -1,15 +1,15 @@ /*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2206 | -| \\ / A nd | Website: www.openfoam.com | -| \\/ M anipulation | | + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 11 + \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { - version 2.0; format ascii; class dictionary; + location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -25,8 +25,9 @@ solvers } } -SIMPLE +PIMPLE { + nCorrectors 2; nNonOrthogonalCorrectors 0; } diff --git a/src/pymm/templates/OpenFOAM/tracerTransport/system/topoSetDict.mako b/src/pymm/templates/OpenFOAM/tracerTransport/system/topoSetDict.mako new file mode 100644 index 0000000..9973129 --- /dev/null +++ b/src/pymm/templates/OpenFOAM/tracerTransport/system/topoSetDict.mako @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 11 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object topoSetDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +actions +( + { + name f0; + type faceSet; + action new; + source patchToFace; + patch inlet; + } + { + name c0; + type cellSet; + action new; + source faceToCell; + option any; + set f0; + } + + { + name c0Zone; + type cellZoneSet; + action new; + source setToCellZone; + set c0; + } + +); + + +// ************************************************************************* //