├── OpenFOAM-2112 └── fishpassage-M1-DES │ ├── fp.foam │ ├── constant │ ├── triSurface │ │ └── fp.stl │ ├── g │ ├── transportProperties │ ├── fvOptions │ └── turbulenceProperties │ ├── 0.model │ ├── include │ │ └── initialConditions │ ├── nut │ ├── k │ ├── omega │ ├── U │ ├── p_rgh │ └── alpha.water │ ├── base.geo │ ├── system │ ├── meshQualityDict │ ├── mapFieldsDict │ ├── mapFieldsDict.initial │ ├── mapFieldsDict.boundary │ ├── setFieldsDict │ ├── decomposeParDict │ ├── decomposeParDict.scotch │ ├── decomposeParDict.ptscotch │ ├── surfaceFeatureExtractDict │ ├── fvSchemes │ ├── fvSolution │ ├── controlDict │ └── snappyHexMeshDict │ └── prepare.sh ├── .gitignore ├── LICENSE.md └── README.MD /OpenFOAM-2112/fishpassage-M1-DES/fp.foam: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | processor* 2 | 0 3 | *.msh 4 | Anim 5 | log 6 | polyMesh 7 | dynamicCode 8 | *.exe 9 | extendedFeatureEdgeMesh 10 | postProcessing 11 | linux64GccDPInt32Opt 12 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/constant/triSurface/fp.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicolasbadano/fishpassage/HEAD/OpenFOAM-2112/fishpassage-M1-DES/constant/triSurface/fp.stl -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/0.model/include/initialConditions: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | Website: https://openfoam.org 5 | \\ / A nd | Version: 8 6 | \\/ M anipulation | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | pressure 0; 10 | turbulentKE 1.53e-05; 11 | turbulentEpsilon 1.85e-09; 12 | turbulentOmega 1.35e-03; 13 | 14 | // ************************************************************************* // 15 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/base.geo: -------------------------------------------------------------------------------- 1 | dx = 0.06; 2 | 3 | originx = -18.5; 4 | originy = 0.0 + (-0.69+0.21)*(originx+18.5)/(17.98+19.01); 5 | originz = -4.6; 6 | 7 | lx = 17.5 - originx; 8 | ly = 2.3 + (-0.69+0.21)*(originx+18.5)/(17.98+19.01) - originy; 9 | lz = 4.6 - originz; 10 | 11 | Point(1) = {originx, originy, originz}; 12 | 13 | Extrude {0, ly, 0} { 14 | Point{1}; Layers{ly/dx}; Recombine; 15 | } 16 | 17 | Extrude {lx, (-0.69+0.21)*lx/(17.98+19.01), 0} { 18 | Line{1}; Layers{lx/dx}; Recombine; 19 | } 20 | 21 | Extrude {0, 0, lz} { 22 | Surface{5}; Layers{lz/dx}; Recombine; 23 | } 24 | 25 | Coherence; 26 | 27 | Physical Surface("inlet") = {14}; 28 | Physical Surface("outlet") = {22}; 29 | Physical Surface("atmosphere") = {18}; 30 | Physical Surface("sides") = {5,26,27}; 31 | Physical Volume(135) = {1}; 32 | Coherence; 33 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/constant/g: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | Website: https://openfoam.org 5 | \\ / A nd | Version: 8 6 | \\/ M anipulation | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile { 9 | version 2.0; 10 | format ascii; 11 | class uniformDimensionedVectorField; 12 | location "constant"; 13 | object g; 14 | } 15 | 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 1 -2 0 0 0 0]; 19 | value (0 -9.81 0); 20 | 21 | 22 | // ************************************************************************* // -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/system/meshQualityDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | Website: https://openfoam.org 5 | \\ / A nd | Version: 8 6 | \\/ M anipulation | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object meshQualityDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | #includeEtc "caseDicts/mesh/generation/meshQualityDict.cfg" 18 | 19 | // ************************************************************************* // 20 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/system/mapFieldsDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | Website: https://openfoam.org 5 | \\ / A nd | Version: 8 6 | \\/ M anipulation | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "system"; 14 | object mapFieldsDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | patchMap ( ); 19 | 20 | cuttingPatches ( inlet ); 21 | 22 | 23 | // ************************************************************************* // 24 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/system/mapFieldsDict.initial: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | Website: https://openfoam.org 5 | \\ / A nd | Version: 8 6 | \\/ M anipulation | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "system"; 14 | object mapFieldsDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | patchMap ( ); 19 | 20 | cuttingPatches ( ); 21 | 22 | 23 | // ************************************************************************* // 24 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/system/mapFieldsDict.boundary: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | Website: https://openfoam.org 5 | \\ / A nd | Version: 8 6 | \\/ M anipulation | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "system"; 14 | object mapFieldsDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | patchMap ( ); 19 | 20 | cuttingPatches ( inlet ); 21 | 22 | 23 | // ************************************************************************* // 24 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/system/setFieldsDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | Website: https://openfoam.org 5 | \\ / A nd | Version: 8 6 | \\/ M anipulation | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile { 9 | version 2.0; 10 | format ascii; 11 | class dictionary; 12 | object setFieldsDict; 13 | } 14 | 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | defaultFieldValues (); 18 | 19 | regions (boxToCell { 20 | box (-1000 -1000 -1000) (1000 1.2 1000); 21 | 22 | fieldValues (volScalarFieldValue alpha.water 1); 23 | }); 24 | 25 | // ************************************************************************* // -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/constant/transportProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | Website: https://openfoam.org 5 | \\ / A nd | Version: 8 6 | \\/ M anipulation | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile { 9 | version 2.0; 10 | format ascii; 11 | class dictionary; 12 | location "constant"; 13 | object transportProperties; 14 | } 15 | 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | phases (water air); 19 | 20 | water { 21 | transportModel Newtonian; 22 | nu 1.20e-06; 23 | rho 1000; 24 | } 25 | 26 | air { 27 | transportModel Newtonian; 28 | nu 1.48e-05; 29 | rho 10; 30 | } 31 | 32 | sigma 0; 33 | 34 | // ************************************************************************* // -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/prepare.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | . /usr/lib/openfoam/openfoam2112/etc/bashrc 3 | 4 | rm -r constant/polyMesh 5 | rm -r 0 6 | rm -r processor* 7 | gmsh -3 base.geo -o base.msh 8 | gmshToFoam base.msh 9 | surfaceFeatureExtract 10 | # ------------------------------------------ 11 | # Run snappyHexMesh in parallel. 12 | # This might be a bit more difficut to setup in cluster environments 13 | cp system/decomposeParDict.scotch system/decomposeParDict 14 | decomposePar 15 | cp system/decomposeParDict.ptscotch system/decomposeParDict 16 | mpirun -np 24 snappyHexMesh -parallel -overwrite | tee log.snappy 17 | reconstructParMesh -constant 18 | renumberMesh -overwrite 19 | cp system/decomposeParDict.scotch system/decomposeParDict 20 | rm -r processor* 21 | # ------------------------------------------ 22 | # Run snappyHexMesh serially. 23 | #snappyHexMesh -overwrite 24 | #renumberMesh -overwrite 25 | cp system/decomposeParDict.scotch system/decomposeParDict 26 | # ------------------------------------------ 27 | 28 | checkMesh 29 | 30 | cp -r 0.model 0 31 | 32 | setFields 33 | 34 | decomposePar -force 35 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/system/decomposeParDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 6 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "system"; 14 | object decomposeParDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | numberOfSubdomains 24; 19 | 20 | method scotch; 21 | 22 | distributed no; 23 | 24 | roots ( ); 25 | 26 | 27 | // ************************************************************************* // 28 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/system/decomposeParDict.scotch: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 6 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "system"; 14 | object decomposeParDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | numberOfSubdomains 24; 19 | 20 | method scotch; 21 | 22 | distributed no; 23 | 24 | roots ( ); 25 | 26 | 27 | // ************************************************************************* // 28 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/system/decomposeParDict.ptscotch: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 6 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "system"; 14 | object decomposeParDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | numberOfSubdomains 24; 19 | 20 | method ptscotch; 21 | 22 | distributed no; 23 | 24 | roots ( ); 25 | 26 | 27 | // ************************************************************************* // 28 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Nicolás Badano 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | # FishPassage 2 | 3 | This repository contains the implementation of an OpenFOAM model for the case of fish passage. It uses `interFoam` to solve the free surface, and a Delayed Eddy Simulation treatment to solve the turbulence, using the `kOmegaSSTDDES` model. 4 | 5 | The model has a couple of interesting features, that apply to other cases: 6 | - A fixed water level boundary condition in the downstream boundary, which is achieved by fixing the pressure (`p_rgh`) in all the wet faces. 7 | - The air velocities attenuation technique explained in this repository: [github.com/nicolasbadano/airVelocityAttenuation](https://github.com/nicolasbadano/airVelocityAttenuation) 8 | 9 | ## Getting Started 10 | 11 | * Run the `prepare.sh` to generate the mesh and set up the simulation. 12 | * Then run the case with `interFoam` 13 | 14 | ## Results 15 | 16 | [![Watch the video](https://img.youtube.com/vi/ytWlFbu8u-I/maxresdefault.jpg)](https://youtu.be/ytWlFbu8u-I) 17 | 18 | ## License 19 | 20 | This project is licensed under the MIT License - see the LICENSE.md file for details 21 | 22 | ## Author 23 | 24 | Nicolás Diego Badano (https://www.linkedin.com/in/nicolas-diego-badano/) 25 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/system/surfaceFeatureExtractDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 2.2.2 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object surfaceFeatureExtractDict; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | fp.stl 18 | { 19 | extractionMethod extractFromSurface; 20 | 21 | extractFromSurfaceCoeffs 22 | { 23 | includedAngle 160; 24 | } 25 | 26 | writeObj yes; 27 | } 28 | 29 | // ************************************************************************* // 30 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/0.model/nut: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | Website: https://openfoam.org 5 | \\ / A nd | Version: 8 6 | \\/ M anipulation | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | location "0"; 14 | object nut; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | dimensions [0 2 -1 0 0 0 0]; 19 | 20 | internalField uniform 0; 21 | 22 | boundaryField 23 | { 24 | inlet 25 | { 26 | type calculated; 27 | value uniform 0; 28 | } 29 | outlet 30 | { 31 | type calculated; 32 | value uniform 0; 33 | } 34 | fixedWalls 35 | { 36 | type nutkRoughWallFunction; 37 | Ks uniform 0.0001; 38 | Cs uniform 0.5; 39 | value uniform 0; 40 | } 41 | atmosphere 42 | { 43 | type calculated; 44 | value uniform 0; 45 | } 46 | } 47 | 48 | // ************************************************************************* // 49 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/0.model/k: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | Website: https://openfoam.org 5 | \\ / A nd | Version: 8 6 | \\/ M anipulation | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | location "0"; 14 | object k; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | #include "include/initialConditions" 19 | 20 | dimensions [0 2 -2 0 0 0 0]; 21 | 22 | internalField uniform $turbulentKE; 23 | 24 | boundaryField 25 | { 26 | inlet 27 | { 28 | type fixedValue; 29 | value $internalField; 30 | } 31 | outlet 32 | { 33 | type inletOutlet; 34 | inletValue $internalField; 35 | value $internalField; 36 | } 37 | fixedWalls 38 | { 39 | type kqRWallFunction; 40 | value uniform 0.0001; 41 | } 42 | atmosphere 43 | { 44 | type inletOutlet; 45 | inletValue $internalField; 46 | value $internalField; 47 | } 48 | } 49 | 50 | // ************************************************************************* // 51 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/0.model/omega: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | Website: https://openfoam.org 5 | \\ / A nd | Version: 8 6 | \\/ M anipulation | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | location "0"; 14 | object omega; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | #include "include/initialConditions" 19 | 20 | dimensions [0 0 -1 0 0 0 0]; 21 | 22 | internalField uniform $turbulentOmega; 23 | 24 | boundaryField 25 | { 26 | inlet 27 | { 28 | type fixedValue; 29 | value $internalField; 30 | } 31 | outlet 32 | { 33 | type inletOutlet; 34 | inletValue $internalField; 35 | value $internalField; 36 | } 37 | fixedWalls 38 | { 39 | type omegaWallFunction; 40 | value $internalField; 41 | } 42 | atmosphere 43 | { 44 | type inletOutlet; 45 | inletValue $internalField; 46 | value $internalField; 47 | } 48 | } 49 | 50 | 51 | // ************************************************************************* // 52 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/0.model/U: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | Website: https://openfoam.org 5 | \\ / A nd | Version: 8 6 | \\/ M anipulation | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volVectorField; 13 | object U; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | #include "include/initialConditions" 18 | 19 | dimensions [0 1 -1 0 0 0 0]; 20 | 21 | internalField uniform (0 0 0); 22 | 23 | boundaryField 24 | { 25 | inlet 26 | { 27 | type variableHeightFlowRateInletVelocity; 28 | flowRate table 29 | ( 30 | ( 0 0.0) 31 | ( 10 4.0) 32 | ( 100 4.0) 33 | ); 34 | alpha alpha.water; 35 | value uniform (0 0 0); 36 | } 37 | outlet 38 | { 39 | type inletOutlet; 40 | inletValue uniform (0 0 0); 41 | value uniform (0 0 0); 42 | } 43 | fixedWalls 44 | { 45 | type noSlip; 46 | } 47 | atmosphere 48 | { 49 | type pressureInletOutletVelocity; 50 | value uniform (0 0 0); 51 | } 52 | } 53 | 54 | // ************************************************************************* // 55 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/system/fvSchemes: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | Website: https://openfoam.org 5 | \\ / A nd | Version: 8 6 | \\/ M anipulation | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "system"; 14 | object fvSchemes; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | ddtSchemes 19 | { 20 | default Euler; 21 | } 22 | 23 | gradSchemes 24 | { 25 | default Gauss linear; 26 | grad(U) cellLimited Gauss skewCorrected linear 1; 27 | limitedGrad cellLimited Gauss linear 1; 28 | } 29 | 30 | divSchemes 31 | { 32 | default none; 33 | div(rhoPhi,U) Gauss linearUpwind grad(U); 34 | div(phi,alpha) Gauss vanLeer; 35 | div(phirb,alpha) Gauss linear; 36 | div(phi,k) Gauss linearUpwind limitedGrad; 37 | div(phi,omega) Gauss linearUpwind limitedGrad; 38 | div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; 39 | } 40 | 41 | 42 | laplacianSchemes 43 | { 44 | default Gauss linear corrected; 45 | } 46 | 47 | interpolationSchemes 48 | { 49 | default linear; 50 | } 51 | 52 | snGradSchemes 53 | { 54 | default corrected; 55 | } 56 | 57 | wallDist 58 | { 59 | method meshWave; 60 | } 61 | 62 | // ************************************************************************* // 63 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/constant/fvOptions: -------------------------------------------------------------------------------- 1 | FoamFile 2 | { 3 | version 2.0; 4 | format ascii; 5 | class dictionary; 6 | location "system"; 7 | object fvOptions; 8 | } 9 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 10 | 11 | airVelocityAttenuation 12 | { 13 | type vectorCodedSource; 14 | active true; 15 | selectionMode all; 16 | 17 | fields (U); 18 | name codedSource; 19 | 20 | codeInclude 21 | #{ 22 | #include "fvmSup.H" 23 | #}; 24 | 25 | codeCorrect 26 | #{ 27 | #}; 28 | 29 | codeAddSupRho 30 | #{ 31 | dimensionedScalar attenuationCoefficient = dimensionedScalar("coef", dimensionSet(0, 0, -1, 0, 0), 20.0); 32 | scalar alphaThreshold = 0.02; 33 | 34 | const GeometricField& psi = eqn.psi(); 35 | 36 | volScalarField& alpha1 = const_cast(mesh_.lookupObject("alpha.water")); 37 | 38 | volScalarField::Internal Sp 39 | ( 40 | IOobject 41 | ( 42 | "USp", 43 | mesh_.time().timeName(), 44 | mesh_, 45 | IOobject::NO_READ, 46 | IOobject::NO_WRITE 47 | ), 48 | mesh_, 49 | dimensioned(eqn.dimensions()/dimVolume/psi.dimensions(), Zero), 50 | false 51 | ); 52 | Sp = -attenuationCoefficient * rho * max(min((alphaThreshold - alpha1) / alphaThreshold, 1.0), 0.0); 53 | 54 | eqn += fvm::SuSp(Sp, psi); 55 | Info << "airVelocityAttenuation: " << "Sp max/min: " << max(Sp) << " / " << min(Sp) << endl; 56 | #}; 57 | 58 | codeConstrain 59 | #{ 60 | #}; 61 | 62 | } 63 | 64 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/0.model/p_rgh: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | Website: https://openfoam.org 5 | \\ / A nd | Version: 8 6 | \\/ M anipulation | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | object p_rgh; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | #include "include/initialConditions" 18 | 19 | dimensions [1 -1 -2 0 0 0 0]; 20 | 21 | internalField uniform $pressure; 22 | 23 | boundaryField 24 | { 25 | inlet 26 | { 27 | type fixedFluxPressure; 28 | } 29 | outlet 30 | { 31 | type codedMixed; 32 | refValue uniform 0; 33 | refGradient uniform 0; 34 | valueFraction uniform 0; 35 | 36 | name fixedWaterPressure; // name of generated BC 37 | 38 | code 39 | #{ 40 | const scalarField rhop = patch().lookupPatchField("rho"); 41 | const scalarField alpha = patch().lookupPatchField("alpha.water"); 42 | this->refValue() = rhop * 9.81 * 1.2; 43 | this->refGrad() = Zero; 44 | this->valueFraction() = alpha; 45 | #}; 46 | } 47 | fixedWalls 48 | { 49 | type fixedFluxPressure; 50 | } 51 | atmosphere 52 | { 53 | type totalPressure; 54 | p0 uniform 0; 55 | } 56 | } 57 | 58 | // ************************************************************************* // 59 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/0.model/alpha.water: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | Website: https://openfoam.org 5 | \\ / A nd | Version: 8 6 | \\/ M anipulation | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class volScalarField; 13 | object alpha.water; 14 | } 15 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 16 | 17 | #include "include/initialConditions" 18 | 19 | dimensions [0 0 0 0 0 0 0]; 20 | 21 | internalField uniform 0; 22 | 23 | boundaryField 24 | { 25 | inlet 26 | { 27 | type codedMixed; 28 | refValue uniform 1; 29 | refGradient uniform 0; 30 | valueFraction uniform 0; 31 | 32 | name alphaWeir; 33 | code 34 | #{ 35 | const scalarField rhop = patch().lookupPatchField("rho"); 36 | this->refValue() = 1; 37 | this->refGrad() = Zero; 38 | this->valueFraction() = max(min(1.2 - 0.2 - this->patch().Cf().component(1), 1.0), 0.0); 39 | #}; 40 | } 41 | outlet 42 | { 43 | type codedMixed; 44 | refValue uniform 1; 45 | refGradient uniform 0; 46 | valueFraction uniform 0; 47 | 48 | name alphaWeir; 49 | code 50 | #{ 51 | const scalarField rhop = patch().lookupPatchField("rho"); 52 | this->refValue() = 1; 53 | this->refGrad() = Zero; 54 | this->valueFraction() = max(min((1.2 - 0.2 - this->patch().Cf().component(1))*5, 1.0), 0.0); 55 | #}; 56 | } 57 | fixedWalls 58 | { 59 | type zeroGradient; 60 | } 61 | atmosphere 62 | { 63 | type inletOutlet; 64 | inletValue uniform 0; 65 | value uniform 0; 66 | } 67 | } 68 | 69 | // ************************************************************************* // 70 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/constant/turbulenceProperties: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: v2006 | 5 | | \\ / A nd | Website: www.openfoam.com | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "constant"; 14 | object turbulenceProperties; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | simulationType LES; 19 | 20 | LES 21 | { 22 | LESModel kOmegaSSTDDES; 23 | 24 | delta cubeRootVol; 25 | 26 | printCoeffs on; 27 | 28 | turbulence on; 29 | 30 | cubeRootVolCoeffs 31 | { 32 | deltaCoeff 1; 33 | } 34 | 35 | PrandtlCoeffs 36 | { 37 | delta cubeRootVol; 38 | cubeRootVolCoeffs 39 | { 40 | deltaCoeff 1; 41 | } 42 | smoothCoeffs 43 | { 44 | delta cubeRootVol; 45 | cubeRootVolCoeffs 46 | { 47 | deltaCoeff 1; 48 | } 49 | maxDeltaRatio 1.1; 50 | } 51 | Cdelta 0.158; 52 | } 53 | 54 | vanDriestCoeffs 55 | { 56 | delta cubeRootVol; 57 | cubeRootVolCoeffs 58 | { 59 | deltaCoeff 1; 60 | } 61 | smoothCoeffs 62 | { 63 | delta cubeRootVol; 64 | cubeRootVolCoeffs 65 | { 66 | deltaCoeff 1; 67 | } 68 | maxDeltaRatio 1.1; 69 | } 70 | Aplus 26; 71 | Cdelta 0.158; 72 | } 73 | 74 | smoothCoeffs 75 | { 76 | delta cubeRootVol; 77 | cubeRootVolCoeffs 78 | { 79 | deltaCoeff 1; 80 | } 81 | maxDeltaRatio 1.1; 82 | } 83 | } 84 | 85 | 86 | // ************************************************************************* // 87 | 88 | 89 | 90 | // ************************************************************************* // 91 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/system/fvSolution: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | | ========= | | 3 | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | 4 | | \\ / O peration | Version: 6 | 5 | | \\ / A nd | Web: www.OpenFOAM.org | 6 | | \\/ M anipulation | | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "system"; 14 | object fvSolution; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | solvers 19 | { 20 | "alpha.water.*" 21 | { 22 | nAlphaCorr 2; 23 | nAlphaSubCycles 2; 24 | cAlpha 1; 25 | 26 | MULESCorr yes; 27 | nLimiterIter 10; 28 | 29 | solver smoothSolver; 30 | smoother symGaussSeidel; 31 | tolerance 1e-16; 32 | relTol 0; 33 | } 34 | 35 | "pcorr.*" 36 | { 37 | solver PCG; 38 | preconditioner 39 | { 40 | preconditioner GAMG; 41 | tolerance 1e-5; 42 | relTol 0; 43 | smoother GaussSeidel; 44 | } 45 | tolerance 1e-8; 46 | relTol 0; 47 | maxIter 50; 48 | } 49 | 50 | p_rgh 51 | { 52 | solver GAMG; 53 | tolerance 1e-6; 54 | relTol 0.1; 55 | 56 | smoother GaussSeidel; 57 | directSolveCoarsest false; 58 | 59 | cacheAgglomeration on; 60 | agglomerator faceAreaPair; 61 | mergeLevels 1; 62 | nCellsInCoarsestLevel 256; 63 | 64 | 65 | minIter 1; 66 | maxIter 1000; 67 | nPreSweeps 0; 68 | nPostSweeps 2; 69 | nFinestSweeps 2; 70 | }; 71 | 72 | p_rghFinal 73 | { 74 | $p_rgh; 75 | tolerance 1e-6; 76 | relTol 0; 77 | } 78 | 79 | "(U|k|omega)" 80 | { 81 | solver smoothSolver; 82 | smoother symGaussSeidel; 83 | nSweeps 1; 84 | tolerance 1e-8; 85 | relTol 0.1; 86 | }; 87 | 88 | "(U|k|omega)Final" 89 | { 90 | solver smoothSolver; 91 | smoother symGaussSeidel; 92 | nSweeps 1; 93 | tolerance 1e-8; 94 | relTol 0; 95 | }; 96 | } 97 | 98 | PIMPLE 99 | { 100 | momentumPredictor yes; 101 | nOuterCorrectors 1; 102 | nCorrectors 3; 103 | nNonOrthogonalCorrectors 1; 104 | 105 | /*maxCo 0.9; 106 | maxAlphaCo 0.5; 107 | 108 | rDeltaTSmoothingCoeff 0.02; 109 | rDeltaTDampingCoeff 0.5; 110 | nAlphaSpreadIter 0; 111 | nAlphaSweepIter 0; 112 | maxDeltaT 0.05;*/ 113 | } 114 | 115 | relaxationFactors 116 | { 117 | equations 118 | { 119 | ".*" 1; 120 | } 121 | } 122 | 123 | cache 124 | { 125 | grad(U); 126 | } 127 | 128 | // ************************************************************************* // 129 | 130 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/system/controlDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | Website: https://openfoam.org 5 | \\ / A nd | Version: 8 6 | \\/ M anipulation | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | location "system"; 14 | object controlDict; 15 | } 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | application interFoam; 19 | 20 | startFrom latestTime; 21 | 22 | startTime 0; 23 | 24 | stopAt endTime; 25 | 26 | endTime 60; 27 | 28 | deltaT 0.001; 29 | 30 | writeControl adjustableRunTime; 31 | 32 | writeInterval 2; 33 | 34 | purgeWrite 0; 35 | 36 | writeFormat binary; 37 | 38 | writePrecision 12; 39 | 40 | writeCompression off; 41 | 42 | timeFormat general; 43 | 44 | timePrecision 12; 45 | 46 | runTimeModifiable yes; 47 | 48 | adjustTimeStep on; 49 | 50 | maxCo 0.5; 51 | maxAlphaCo 0.5; 52 | 53 | maxDeltaT 0.01; 54 | 55 | libs ("libvariableHeightFlowRateInletUniformVelocity.so"); 56 | 57 | functions 58 | { 59 | yPlus1 60 | { 61 | type yPlus; 62 | libs ("libfieldFunctionObjects.so"); 63 | writeControl writeTime; 64 | writeInterval 1; 65 | } 66 | CourantNo1 67 | { 68 | type CourantNo; 69 | libs ("libfieldFunctionObjects.so"); 70 | writeControl writeTime; 71 | writeInterval 1; 72 | } 73 | outlet 74 | { 75 | type surfaceFieldValue; 76 | libs ("libfieldFunctionObjects.so"); 77 | writeControl timeStep; 78 | writeInterval 1; 79 | writeFields false; 80 | log false; 81 | regionType patch; 82 | name outlet; 83 | operation sum; 84 | fields 85 | ( 86 | alphaPhi0.water 87 | ); 88 | } 89 | 90 | 91 | surfaceSampling 92 | { 93 | type surfaces; 94 | libs (sampling); 95 | writeControl runTime; 96 | writeInterval 0.05; 97 | 98 | interpolationScheme cellPointWallModified; 99 | 100 | surfaceFormat ensight; 101 | 102 | formatOptions 103 | { 104 | vtp 105 | { 106 | format binary; 107 | } 108 | } 109 | 110 | // Fields to be sampled 111 | fields 112 | ( 113 | U 114 | k 115 | omega 116 | nut 117 | alpha.water 118 | p_rgh 119 | ); 120 | 121 | surfaces 122 | { 123 | freeSurface 124 | { 125 | type isoSurface; 126 | isoField alpha.water; 127 | isoValue 0.5; 128 | interpolate true; 129 | } 130 | yNormal 131 | { 132 | type cuttingPlane; 133 | planeType pointAndNormal; 134 | pointAndNormalDict { 135 | point (0 1 0); 136 | normal (0 1 0); 137 | } 138 | interpolate true; 139 | } 140 | yNormal 141 | { 142 | type cuttingPlane; 143 | planeType pointAndNormal; 144 | pointAndNormalDict { 145 | point (0 0.6 0); 146 | normal (0 1 0); 147 | } 148 | interpolate true; 149 | } 150 | zNormalL 151 | { 152 | type cuttingPlane; 153 | planeType pointAndNormal; 154 | pointAndNormalDict { 155 | point (0 0 -3.2); 156 | normal (0 0 1); 157 | } 158 | interpolate true; 159 | } 160 | zNormalR 161 | { 162 | type cuttingPlane; 163 | planeType pointAndNormal; 164 | pointAndNormalDict { 165 | point (0 0 3.2); 166 | normal (0 0 1); 167 | } 168 | interpolate true; 169 | } 170 | } 171 | } 172 | 173 | fieldAverage1 174 | { 175 | type fieldAverage; 176 | libs ("libfieldFunctionObjects.so"); 177 | writeControl writeTime; 178 | restartOnRestart no; 179 | restartOnOutput no; 180 | timeStart 40; 181 | timeEnd 60; 182 | fields 183 | ( 184 | U 185 | { 186 | mean on; 187 | prime2Mean off; 188 | base time; 189 | } 190 | 191 | alpha.water 192 | { 193 | mean on; 194 | prime2Mean off; 195 | base time; 196 | } 197 | 198 | p_rgh 199 | { 200 | mean on; 201 | prime2Mean off; 202 | base time; 203 | } 204 | 205 | k 206 | { 207 | mean on; 208 | prime2Mean off; 209 | base time; 210 | } 211 | 212 | omega 213 | { 214 | mean on; 215 | prime2Mean off; 216 | base time; 217 | } 218 | 219 | nut 220 | { 221 | mean on; 222 | prime2Mean off; 223 | base time; 224 | } 225 | ); 226 | } 227 | } 228 | 229 | // ************************************************************************* // 230 | -------------------------------------------------------------------------------- /OpenFOAM-2112/fishpassage-M1-DES/system/snappyHexMeshDict: -------------------------------------------------------------------------------- 1 | /*--------------------------------*- C++ -*----------------------------------*\ 2 | ========= | 3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 4 | \\ / O peration | Website: https://openfoam.org 5 | \\ / A nd | Version: 8 6 | \\/ M anipulation | 7 | \*---------------------------------------------------------------------------*/ 8 | FoamFile 9 | { 10 | version 2.0; 11 | format ascii; 12 | class dictionary; 13 | object snappyHexMeshDict; 14 | } 15 | 16 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 17 | 18 | // Which of the steps to run 19 | castellatedMesh true; 20 | snap true; 21 | addLayers true; 22 | 23 | 24 | // Geometry. Definition of all surfaces. All surfaces are of class 25 | // searchableSurface. 26 | // Surfaces are used 27 | // - to specify refinement for any mesh cell intersecting it 28 | // - to specify refinement for any mesh cell inside/outside/near 29 | // - to 'snap' the mesh boundary to the surface 30 | geometry 31 | { 32 | fixedWalls 33 | { 34 | type triSurfaceMesh; 35 | file "fp.stl"; 36 | } 37 | /*blockDF1 38 | { 39 | type triSurfaceMesh; 40 | file "BlockDF1.stl"; 41 | }*/ 42 | }; 43 | 44 | // Settings for the castellatedMesh generation. 45 | castellatedMeshControls 46 | { 47 | 48 | // Refinement parameters 49 | // ~~~~~~~~~~~~~~~~~~~~~ 50 | 51 | // If local number of cells is >= maxLocalCells on any processor 52 | // switches from from refinement followed by balancing 53 | // (current method) to (weighted) balancing before refinement. 54 | maxLocalCells 10000000; 55 | 56 | // Overall cell limit (approximately). Refinement will stop immediately 57 | // upon reaching this number so a refinement level might not complete. 58 | // Note that this is the number of cells before removing the part which 59 | // is not 'visible' from the keepPoint. The final number of cells might 60 | // actually be a lot less. 61 | maxGlobalCells 20000000; 62 | 63 | // The surface refinement loop might spend lots of iterations refining just a 64 | // few cells. This setting will cause refinement to stop if <= minimumRefine 65 | // are selected for refinement. Note: it will at least do one iteration 66 | // (unless the number of cells to refine is 0) 67 | minRefinementCells 10; 68 | 69 | // Number of buffer layers between different levels. 70 | // 1 means normal 2:1 refinement restriction, larger means slower 71 | // refinement. 72 | nCellsBetweenLevels 2; 73 | 74 | 75 | // Explicit feature edge refinement 76 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 77 | 78 | // Specifies a level for any cell intersected by its edges. 79 | // This is a featureEdgeMesh, read from constant/triSurface for now. 80 | features 81 | ( 82 | { 83 | file "fp.eMesh"; 84 | level 1; 85 | } 86 | ); 87 | 88 | // Surface based refinement 89 | // ~~~~~~~~~~~~~~~~~~~~~~~~ 90 | 91 | // Specifies two levels for every surface. The first is the minimum level, 92 | // every cell intersecting a surface gets refined up to the minimum level. 93 | // The second level is the maximum level. Cells that 'see' multiple 94 | // intersections where the intersections make an 95 | // angle > resolveFeatureAngle get refined up to the maximum level. 96 | 97 | refinementSurfaces 98 | { 99 | "(fixedWalls|inlet|outlet)" 100 | { 101 | // Surface-wise min and max refinement level 102 | level (0 0); 103 | 104 | // Optional specification of patch type (default is wall). No 105 | // constraint types (cyclic, symmetry) etc. are allowed. 106 | patchInfo 107 | { 108 | type wall; 109 | inGroups (fixedWallsGroup); 110 | } 111 | } 112 | } 113 | 114 | resolveFeatureAngle 20; //was 30 115 | 116 | 117 | // Region-wise refinement 118 | // ~~~~~~~~~~~~~~~~~~~~~~ 119 | 120 | // Specifies refinement level for cells in relation to a surface. One of 121 | // three modes 122 | // - distance. 'levels' specifies per distance to the surface the 123 | // wanted refinement level. The distances need to be specified in 124 | // descending order. 125 | // - inside. 'levels' is only one entry and only the level is used. All 126 | // cells inside the surface get refined up to the level. The surface 127 | // needs to be closed for this to be possible. 128 | // - outside. Same but cells outside. 129 | 130 | refinementRegions 131 | { 132 | fixedWalls 133 | { 134 | mode distance; 135 | levels ((0.5 0)); // levels (distance(m) refinement_level) 136 | } 137 | } 138 | 139 | 140 | // Mesh selection 141 | // ~~~~~~~~~~~~~~ 142 | 143 | // After refinement patches get added for all refinementSurfaces and 144 | // all cells intersecting the surfaces get put into these patches. The 145 | // section reachable from the locationInMesh is kept. 146 | // NOTE: This point should never be on a face, always inside a cell, even 147 | // after refinement. 148 | locationInMesh (17.0002 1.0002 -3.0002); 149 | 150 | 151 | // Whether any faceZones (as specified in the refinementSurfaces) 152 | // are only on the boundary of corresponding cellZones or also allow 153 | // free-standing zone faces. Not used if there are no faceZones. 154 | allowFreeStandingZoneFaces true; 155 | } 156 | 157 | 158 | // Settings for the snapping. 159 | snapControls 160 | { 161 | //- Number of patch smoothing iterations before finding correspondence 162 | // to surface 163 | nSmoothPatch 3; //8 164 | 165 | //- Relative distance for points to be attracted by surface feature point 166 | // or edge. True distance is this factor times local 167 | // maximum edge length. 168 | tolerance 1.2; //2.0 169 | 170 | //- Number of mesh displacement relaxation iterations. 171 | nSolveIter 30; //30 172 | 173 | //- Maximum number of snapping relaxation iterations. Should stop 174 | // before upon reaching a correct mesh. 175 | nRelaxIter 20; //5 / 20 176 | 177 | nFeatureSnapIter 30; //10 178 | 179 | //**NEW 180 | //- Detect (geometric only) features by sampling the surface 181 | // (default=false). 182 | implicitFeatureSnap false; 183 | 184 | //- Use castellatedMeshControls::features (default = true) 185 | explicitFeatureSnap true; 186 | 187 | //- Detect points on multiple surfaces (only for explicitFeatureSnap) 188 | multiRegionFeatureSnap true; 189 | //** 190 | } 191 | 192 | 193 | // Settings for the layer addition. 194 | addLayersControls 195 | { 196 | // Are the thickness parameters below relative to the undistorted 197 | // size of the refined cell outside layer (true) or absolute sizes (false). 198 | relativeSizes true; 199 | 200 | // Per final patch (so not geometry!) the layer information 201 | layers 202 | { 203 | fixedWalls 204 | { 205 | nSurfaceLayers 4; 206 | } 207 | } 208 | 209 | // Expansion factor for layer mesh 210 | expansionRatio 1.5; 211 | 212 | 213 | // Wanted thickness of final added cell layer. If multiple layers 214 | // is the thickness of the layer furthest away from the wall. 215 | // Relative to undistorted size of cell outside layer. 216 | // See relativeSizes parameter. 217 | finalLayerThickness 0.4; 218 | 219 | // Minimum thickness of cell layer. If for any reason layer 220 | // cannot be above minThickness do not add layer. 221 | // See relativeSizes parameter. 222 | minThickness 0.000001; 223 | 224 | // If points get not extruded do nGrow layers of connected faces that are 225 | // also not grown. This helps convergence of the layer addition process 226 | // close to features. 227 | // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x) 228 | nGrow 0; 229 | 230 | 231 | // Advanced settings 232 | 233 | // When not to extrude surface. 0 is flat surface, 90 is when two faces 234 | // are perpendicular 235 | featureAngle 60; 236 | 237 | //**NEW 238 | // At non-patched sides allow mesh to slip if extrusion direction makes 239 | // angle larger than slipFeatureAngle. 240 | slipFeatureAngle 30; 241 | //** 242 | 243 | // Number of smoothing iterations of surface normals 244 | nSmoothSurfaceNormals 5; //1 245 | 246 | // Number of smoothing iterations of interior mesh movement direction 247 | nSmoothNormals 15; //3 248 | 249 | // Smooth layer thickness over surface patches 250 | nSmoothThickness 10; //10 (50 gave 2) 251 | 252 | // Stop layer growth on highly warped cells 253 | maxFaceThicknessRatio 0.5; //0.5 254 | 255 | // Reduce layer growth where ratio thickness to medial 256 | // distance is large 257 | maxThicknessToMedialRatio 3; //0.3 258 | 259 | // Angle used to pick up medial axis points 260 | // Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130 in 17x. 261 | minMedianAxisAngle 80; 262 | 263 | // Create buffer region for new layer terminations 264 | nBufferCellsNoExtrude 0; //0 265 | 266 | 267 | // Overall max number of layer addition iterations. The mesher will exit 268 | // if it reaches this number of iterations; possibly with an illegal 269 | // mesh. 270 | nLayerIter 400; 271 | 272 | // Maximum number of snapping relaxation iterations. Should stop 273 | // before upon reaching a correct mesh. 274 | nRelaxIter 200; 275 | 276 | // Max number of iterations after which relaxed meshQuality controls 277 | // get used. Up to nRelaxIter it uses the settings in meshQualityControls, 278 | // after nRelaxIter it uses the values in meshQualityControls::relaxed. 279 | nRelaxedIter 40; 280 | } 281 | 282 | 283 | 284 | // Generic mesh quality settings. At any undoable phase these determine 285 | // where to undo. 286 | meshQualityControls 287 | { 288 | // Default mesh quality dict 289 | //maxNonOrtho 65; 290 | //maxBoundarySkewness 20; 291 | //maxInternalSkewness 4; 292 | maxConcave 85; 293 | // Minimum cell pyramid volume; case dependent 294 | //minVol 1e-13; 295 | // 1e-15 (small positive) to enable tracking 296 | // -1e+30 (large negative) for best layer insertion 297 | //minTetQuality 1e-15; 298 | // if >0 : preserve single cells with all points on the surface if the 299 | // resulting volume after snapping (by approximation) is larger than 300 | // minVolCollapseRatio times old volume (i.e. not collapsed to flat cell). 301 | // If <0 : delete always. 302 | //minVolCollapseRatio 0.5; 303 | minArea -1; 304 | //minTwist 0.02; 305 | //minDeterminant 0.001; 306 | //minFaceWeight 0.05; 307 | //minVolRatio 0.01; 308 | minTriangleTwist -1; 309 | nSmoothScale 10; 310 | errorReduction 0.95; 311 | relaxed 312 | { 313 | maxNonOrtho 78; 314 | } 315 | 316 | maxNonOrtho 75; 317 | minFaceWeight 0.00005; 318 | minDeterminant 0.0000001; 319 | minVolRatio 0.00001; 320 | // Set to very negative number (e.g. -1E30) to disable and get best layer adding 321 | minTetQuality -1e+20; 322 | minVol 1e-14; 323 | minTwist 0.00001; 324 | maxBoundarySkewness 30; 325 | maxInternalSkewness 6; 326 | } 327 | 328 | 329 | // Advanced 330 | 331 | // Flags for optional output 332 | // 0 : only write final meshes 333 | // 1 : write intermediate meshes 334 | // 2 : write volScalarField with cellLevel for postprocessing 335 | // 4 : write current intersections as .obj files 336 | debug 0; 337 | 338 | // Advanced 339 | 340 | // Merge tolerance. Is fraction of overall bounding box of initial mesh. 341 | // Note: the write tolerance needs to be higher than this. 342 | mergeTolerance 1E-8; 343 | 344 | 345 | // ************************************************************************* // 346 | --------------------------------------------------------------------------------