mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Adding subMesh option to momentumError and div FOs
1) Adding subMesh capabilities to momentumError and div FOs. - A subMesh is created from cellZones. - The operators (div, etc) are only calculated in the subMesh. 2) Optionally, halo cells can be added to the cellZones. 3) New helper class to handle the subMesh creation and field mapping.
This commit is contained in:
@ -3,19 +3,9 @@ cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
mkdir -p constant/geometry
|
||||
./Allrun.pre
|
||||
|
||||
cp -f \
|
||||
"$FOAM_TUTORIALS"/resources/geometry/NACA0012.obj.gz \
|
||||
constant/geometry
|
||||
|
||||
restore0Dir
|
||||
|
||||
runApplication blockMesh
|
||||
|
||||
runApplication transformPoints -scale "(1 0 1)"
|
||||
|
||||
runApplication extrudeMesh
|
||||
runApplication topoSet
|
||||
|
||||
runApplication $(getApplication)
|
||||
|
||||
|
||||
18
tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/Allrun-parallel
Executable file
18
tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/Allrun-parallel
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
./Allrun.pre
|
||||
|
||||
runParallel -s decompose \
|
||||
redistributePar -decompose -overwrite -withZero
|
||||
|
||||
runParallel topoSet
|
||||
|
||||
runParallel $(getApplication)
|
||||
|
||||
runParallel -s reconstruct \
|
||||
redistributePar -reconstruct -overwrite
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
20
tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/Allrun.pre
Executable file
20
tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/Allrun.pre
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
mkdir -p constant/geometry
|
||||
|
||||
cp -f \
|
||||
"$FOAM_TUTORIALS"/resources/geometry/NACA0012.obj.gz \
|
||||
constant/geometry
|
||||
|
||||
restore0Dir
|
||||
|
||||
runApplication blockMesh
|
||||
|
||||
runApplication transformPoints -scale "(1 0 1)"
|
||||
|
||||
runApplication extrudeMesh
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -16,7 +16,7 @@ FoamFile
|
||||
|
||||
application rhoSimpleFoam;
|
||||
|
||||
startFrom latestTime;
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
@ -34,7 +34,7 @@ purgeWrite 0;
|
||||
|
||||
writeFormat ascii;
|
||||
|
||||
writePrecision 8;
|
||||
writePrecision 8;
|
||||
|
||||
writeCompression off;
|
||||
|
||||
@ -48,6 +48,33 @@ functions
|
||||
{
|
||||
#includeFunc MachNo
|
||||
#includeFunc solverInfo
|
||||
|
||||
readFields1
|
||||
{
|
||||
type readFields;
|
||||
libs (fieldFunctionObjects);
|
||||
fields (phi);
|
||||
readOnStart true;
|
||||
}
|
||||
|
||||
contErr
|
||||
{
|
||||
type div;
|
||||
libs (fieldFunctionObjects);
|
||||
field phi;
|
||||
executeControl writeTime;
|
||||
writeControl writeTime;
|
||||
}
|
||||
|
||||
momErr
|
||||
{
|
||||
type momentumError;
|
||||
libs (fieldFunctionObjects);
|
||||
cellZones (z1);
|
||||
nLayers 2;
|
||||
executeControl writeTime;
|
||||
writeControl writeTime;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object decomposeParDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
numberOfSubdomains 8;
|
||||
|
||||
method hierarchical;
|
||||
|
||||
coeffs
|
||||
{
|
||||
n (4 1 2);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -27,6 +27,7 @@ gradSchemes
|
||||
grad(U) $limited;
|
||||
grad(k) $limited;
|
||||
grad(omega) $limited;
|
||||
grad(subsetU) $limited;
|
||||
}
|
||||
|
||||
divSchemes
|
||||
|
||||
@ -0,0 +1,37 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2106 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object topoSetDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
actions
|
||||
(
|
||||
{
|
||||
name c1;
|
||||
type cellSet;
|
||||
action new;
|
||||
source boxToCell;
|
||||
box (-0.2 -0.1 -0.2) (1.2 0.1 0.2);
|
||||
}
|
||||
|
||||
{
|
||||
name z1;
|
||||
type cellZoneSet;
|
||||
action new;
|
||||
source setToCellZone;
|
||||
set c1; // cellSet
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user