ENH: support operations on surfFields in surfaceFieldValue

- this makes it possible to perform additional operations
  on surface values that have been previously sampled.

- support vectorField for weighting operations.

- reduce overhead by avoiding creation of weight fields, Sf fields
  and combined surface geometries unless they are actually required.

- extend some similar concepts and operations to volFieldValue
This commit is contained in:
Mark Olesen
2017-03-02 14:50:36 +01:00
parent 3f1c72356f
commit 2853678a60
45 changed files with 130798 additions and 374 deletions

View File

@ -0,0 +1,41 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 300;
boundaryField
{
"inlet.*"
{
type fixedValue;
value $internalField;
}
outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
".*"
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,53 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet_air
{
type flowRateInletVelocity;
massFlowRate constant 0.095;
value uniform (0 0 0);
}
inlet_fuel
{
type flowRateInletVelocity;
massFlowRate constant 0.005;
value uniform (0 0 0);
}
outlet
{
type pressureInletOutletVelocity;
inletValue (0 0 0);
value $internalField;
}
"wall.*"
{
type noSlip;
}
".*"
{
type fixedValue;
value uniform (0 0 0);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,41 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object alphat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 1e-3;
boundaryField
{
"inlet.*"
{
type calculated;
value $internalField;
}
outlet
{
type calculated;
value $internalField;
}
"wall.*"
{
type compressible::alphatWallFunction;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,53 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -3 0 0 0 0];
internalField uniform 100;
boundaryField
{
inlet_air
{
type turbulentMixingLengthDissipationRateInlet;
mixingLength 0.005;
value $internalField;
}
inlet_fuel
{
type turbulentMixingLengthDissipationRateInlet;
mixingLength 0.001;
value $internalField;
}
outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
"inlet.*"
{
type zeroGradient;
}
"wall.*"
{
type epsilonWallFunction;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 6;
boundaryField
{
inlet_air
{
type turbulentIntensityKineticEnergyInlet;
intensity 0.05;
value $internalField;
}
inlet_fuel
{
type turbulentIntensityKineticEnergyInlet;
intensity 0.05;
value $internalField;
}
outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
".*"
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,41 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
"inlet.*"
{
type calculated;
value $internalField;
}
outlet
{
type calculated;
value $internalField;
}
"wall.*"
{
type nutUWallFunction;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,35 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 1e5;
boundaryField
{
outlet
{
type fixedValue;
value $internalField;
}
".*"
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,47 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object tracer0;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet_air
{
type fixedValue;
value uniform 0;
}
inlet_fuel
{
type fixedValue;
value uniform 1;
}
outlet
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
".*"
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,13 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase
rm -rf 0
rm -f constant/triSurface/*.eMesh* > /dev/null 2>&1
rm -rf constant/extendedFeatureEdgeMesh > /dev/null 2>&1
#------------------------------------------------------------------------------

View File

@ -0,0 +1,13 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
./Allrun.mesh
restore0Dir
runApplication decomposePar -force
runParallel rhoSimpleFoam
#------------------------------------------------------------------------------

View File

@ -0,0 +1,13 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication surfaceFeatureExtract
runApplication snappyHexMesh -overwrite
rm -rf 0
#------------------------------------------------------------------------------

View File

@ -0,0 +1 @@
Demonstration of simple gas mixing, with processing on surface fields.

View File

@ -0,0 +1,56 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
{
type hePsiThermo;
mixture pureMixture;
transport sutherland;
thermo hConst;
equationOfState perfectGas;
specie specie;
energy sensibleInternalEnergy;
}
// SIMPLE
thermoType
{
type heRhoThermo;
}
mixture
{
specie
{
nMoles 1;
molWeight 28.9;
}
thermodynamics
{
Cp 1007;
Hf 0;
}
transport
{
As 1.4792e-06;
Ts 116;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,268 @@
solid fuel_inlet
facet normal 0 0 -1
outer loop
vertex 0.103873 0.00419647 0.1
vertex 0.109249 0.00380166 0.1
vertex 0.106039 -0.000293039 0.1
endloop
endfacet
facet normal 0 -0 -1
outer loop
vertex 0.107097 0.00704535 0.1
vertex 0.109249 0.00380166 0.1
vertex 0.103873 0.00419647 0.1
endloop
endfacet
facet normal 0 -0 -1
outer loop
vertex 0.103873 0.00419647 0.1
vertex 0.106039 -0.000293039 0.1
vertex 0.102084 0.000583721 0.1
endloop
endfacet
facet normal 0 -0 -1
outer loop
vertex 0.109249 0.00380166 0.1
vertex 0.11 0 0.1
vertex 0.106039 -0.000293039 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.103852 0.00922834 0.1
vertex 0.107097 0.00704535 0.1
vertex 0.103873 0.00419647 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.102084 0.000583721 0.1
vertex 0.0989737 0.00243444 0.1
vertex 0.103873 0.00419647 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.102311 -0.00254505 0.1
vertex 0.102084 0.000583721 0.1
vertex 0.106039 -0.000293039 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.11 0 0.1
vertex 0.109249 -0.00380166 0.1
vertex 0.106039 -0.000293039 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.103873 0.00419647 0.1
vertex 0.099792 0.00657993 0.1
vertex 0.103852 0.00922834 0.1
endloop
endfacet
facet normal -0 0 -1
outer loop
vertex 0.102084 0.000583721 0.1
vertex 0.0987304 -0.00168894 0.1
vertex 0.0989737 0.00243444 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.0989737 0.00243444 0.1
vertex 0.099792 0.00657993 0.1
vertex 0.103873 0.00419647 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.106039 -0.000293039 0.1
vertex 0.104805 -0.00474297 0.1
vertex 0.102311 -0.00254505 0.1
endloop
endfacet
facet normal 0 -0 -1
outer loop
vertex 0.102084 0.000583721 0.1
vertex 0.102311 -0.00254505 0.1
vertex 0.0987304 -0.00168894 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.104805 -0.00474297 0.1
vertex 0.106039 -0.000293039 0.1
vertex 0.109249 -0.00380166 0.1
endloop
endfacet
facet normal 0 -0 -1
outer loop
vertex 0.1 0.01 0.1
vertex 0.103852 0.00922834 0.1
vertex 0.099792 0.00657993 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.0989737 0.00243444 0.1
vertex 0.0987304 -0.00168894 0.1
vertex 0.0943497 0.000109063 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.0955515 0.00475557 0.1
vertex 0.099792 0.00657993 0.1
vertex 0.0989737 0.00243444 0.1
endloop
endfacet
facet normal -0 0 -1
outer loop
vertex 0.104805 -0.00474297 0.1
vertex 0.100159 -0.00601788 0.1
vertex 0.102311 -0.00254505 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.0987304 -0.00168894 0.1
vertex 0.102311 -0.00254505 0.1
vertex 0.100159 -0.00601788 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.109249 -0.00380166 0.1
vertex 0.107097 -0.00704535 0.1
vertex 0.104805 -0.00474297 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.0961732 0.0092388 0.1
vertex 0.1 0.01 0.1
vertex 0.099792 0.00657993 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.0943497 0.000109063 0.1
vertex 0.0955515 0.00475557 0.1
vertex 0.0989737 0.00243444 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.0955808 -0.00457201 0.1
vertex 0.0943497 0.000109063 0.1
vertex 0.0987304 -0.00168894 0.1
endloop
endfacet
facet normal -0 0 -1
outer loop
vertex 0.099792 0.00657993 0.1
vertex 0.0955515 0.00475557 0.1
vertex 0.0961732 0.0092388 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.100159 -0.00601788 0.1
vertex 0.104805 -0.00474297 0.1
vertex 0.103852 -0.00922834 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.100159 -0.00601788 0.1
vertex 0.0955808 -0.00457201 0.1
vertex 0.0987304 -0.00168894 0.1
endloop
endfacet
facet normal -0 0 -1
outer loop
vertex 0.107097 -0.00704535 0.1
vertex 0.103852 -0.00922834 0.1
vertex 0.104805 -0.00474297 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.0955515 0.00475557 0.1
vertex 0.0943497 0.000109063 0.1
vertex 0.0907612 0.00382683 0.1
endloop
endfacet
facet normal 0 -0 -1
outer loop
vertex 0.0943497 0.000109063 0.1
vertex 0.0955808 -0.00457201 0.1
vertex 0.0907612 -0.00382683 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.0929289 0.00707107 0.1
vertex 0.0961732 0.0092388 0.1
vertex 0.0955515 0.00475557 0.1
endloop
endfacet
facet normal -0 0 -1
outer loop
vertex 0.103852 -0.00922834 0.1
vertex 0.1 -0.01 0.1
vertex 0.100159 -0.00601788 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.0955808 -0.00457201 0.1
vertex 0.100159 -0.00601788 0.1
vertex 0.0961732 -0.0092388 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.0907612 0.00382683 0.1
vertex 0.0929289 0.00707107 0.1
vertex 0.0955515 0.00475557 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.09 -4.64102e-10 0.1
vertex 0.0907612 0.00382683 0.1
vertex 0.0943497 0.000109063 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.0907612 -0.00382683 0.1
vertex 0.09 -4.64102e-10 0.1
vertex 0.0943497 0.000109063 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.0929289 -0.00707107 0.1
vertex 0.0907612 -0.00382683 0.1
vertex 0.0955808 -0.00457201 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.1 -0.01 0.1
vertex 0.0961732 -0.0092388 0.1
vertex 0.100159 -0.00601788 0.1
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 0.0961732 -0.0092388 0.1
vertex 0.0929289 -0.00707107 0.1
vertex 0.0955808 -0.00457201 0.1
endloop
endfacet
endsolid fuel_inlet

View File

@ -0,0 +1,30 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RAS;
RAS
{
RASModel kEpsilon;
turbulence on;
printCoeffs on;
}
// ************************************************************************* //

View File

@ -0,0 +1,23 @@
// -*- C++ -*-
//
// Averaging of volume fields or fields on an externally loaded surface.
avg-tracer0-0.25
{
${settings_avg}
subRegion plane-0.25;
}
avg-tracer0-0.45
{
${settings_avg}
subRegion plane-0.45;
}
avg-tracer0-0.55
{
${settings_avg}
subRegion plane-0.55;
}
// ************************************************************************* //

View File

@ -0,0 +1,40 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: http://www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
vertices
(
(-0.5 -0.125 -0.25)
(1.5 -0.125 -0.25)
(1.5 0.125 -0.25)
(-0.5 0.125 -0.25)
(-0.5 -0.125 0.25)
(1.5 -0.125 0.25)
(1.5 0.125 0.25)
(-0.5 0.125 0.25)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (32 4 8) simpleGrading (1 1 1)
);
edges
();
patches
();
// ************************************************************************* //

View File

@ -0,0 +1,72 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhoSimpleFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 0.4;
deltaT 1e-04;
writeControl adjustableRunTime;
writeInterval 2e-3;
purgeWrite 0;
writeFormat binary;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep yes;
maxCo 0.5;
// SIMPLE
endTime 1200;
deltaT 1;
writeInterval 100;
#include "sampleControls"
functions
{
#include "scalarTransport"
#include "sampling"
}
OptimisationSwitches
{
// Force dumping (at next timestep) upon signal: 12 = USR2
writeNowSignal 12;
}
// ************************************************************************* //

View File

@ -0,0 +1,32 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 8;
method hierarchical;
hierarchicalCoeffs
{
n ( 2 2 2 );
delta 0.001;
order xyz;
}
preservePatches ();
// ************************************************************************* //

View File

@ -0,0 +1,45 @@
// -*- C++ -*-
// ************************************************************************* //
// Transcribe volume fields to surfaces.
fieldTransfer
{
type surfMeshes;
libs ("libsampling.so");
log true;
writeControl none;
createOnRead true;
executeControl timeStep;
executeInterval 1;
fields (rho U tracer0);
derived (rhoU);
baseCfg
{
type sampledTriSurfaceMesh;
source cells;
}
surfaces
(
plane-0.25
{
$baseCfg
surface plane-0.25.stl;
}
plane-0.45
{
$baseCfg
surface plane-0.45.stl;
}
plane-0.55
{
$baseCfg
surface plane-0.55.stl;
}
);
}
// ************************************************************************* //

View File

@ -0,0 +1,64 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default leastSquares;
grad(U) cellLimited Gauss linear 0.99;
}
divSchemes
{
default none;
div(phi,U) Gauss limitedLinearV 1;
div(phid,p) Gauss limitedLinear 1;
div(phi,K) Gauss limitedLinear 1;
div(phi,k) Gauss limitedLinear 1;
div(phi,h) Gauss limitedLinear 1;
div(phi,e) Gauss limitedLinear 1;
div(phi,Ekp) Gauss limitedLinear 1;
div(phi,T) Gauss limitedLinear 1;
div(phi,tracer0) Gauss limitedLinear 1;
div(phi,epsilon) Gauss limitedLinear 1;
div(R) Gauss linear;
div(U) Gauss linear;
div((Su*n)) Gauss linear;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
// ************************************************************************* //

View File

@ -0,0 +1,152 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
"(p|rho)"
{
solver GAMG;
tolerance 1e-08;
relTol 0.05;
smoother symGaussSeidel;
nCellsInCoarsestLevel 200;
}
"(U|k|epsilon|tracer0)"
{
solver smoothSolver;
smoother symGaussSeidel;
nSweeps 2;
tolerance 1e-06;
relTol 0.1;
minIter 1;
}
e
{
solver PBiCGStab;
preconditioner DILU;
nSweeps 2;
tolerance 1e-06;
relTol 0.1;
minIter 1;
}
"(p|rho)Final"
{
$p;
tolerance 1e-06;
relTol 0;
minIter 1;
}
"(U|k|epsilon|tracer0)Final"
{
$U;
tolerance 1e-05;
relTol 0;
minIter 1;
}
eFinal
{
$e;
tolerance 1e-05;
relTol 0;
minIter 1;
}
}
PIMPLE
{
nOuterCorrectors 2;
nCorrectors 1;
nNonOrthogonalCorrectors 0;
rhoMin 0.3;
rhoMax 2.0;
}
potentialFlow
{
nNonOrthogonalCorrectors 20;
}
SIMPLE
{
nNonOrthogonalCorrectors 0;
rhoMin 0.3;
rhoMax 1.4;
transonic false;
// consistent yes;
residualControl
{
p 1e-3;
U 1e-4;
e 1e-3;
// possibly check turbulence fields
"(k|epsilon|omega)" 1e-3;
}
// 2.4.x
rhoMin rhoMin [1 -3 0 0 0 0 0] 0.3;
rhoMax rhoMax [1 -3 0 0 0 0 0] 1.4;
}
relaxationFactors-SIMPLE
{
fields
{
p 0.3;
rho 0.05;
}
equations
{
U 0.7;
"(k|epsilon)" 0.7;
e 0.5;
tracer0 1;
".*Final" 1.0;
}
}
relaxationFactors-PIMPLE
{
equations
{
U 0.95;
"(k|epsilon)" 0.95;
e 0.95;
tracer0 1;
".*Final" 1.0;
}
}
// relaxationFactors { $relaxationFactors-PIMPLE }
relaxationFactors { $relaxationFactors-SIMPLE }
// ************************************************************************* //

View File

@ -0,0 +1,23 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object meshQualityDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Include defaults parameters from master dictionary
#include "$WM_PROJECT_DIR/etc/caseDicts/meshQualityDict"
maxNonOrtho 55;
// ************************************************************************* //

View File

@ -0,0 +1,101 @@
// -*- C++ -*-
// Averaging of volume fields or fields on an externally loaded surface.
//
// fields [required]
// The fields and the specification for the type of averaging needed.
//
// The 'execute' control triggers the averaging.
// The 'output/write' control is optional.
//
// The averaging can be optionally restart in two ways:
//
// periodicRestart / restartPeriod:
// - reset at defined intervals
//
// restartTime:
// - a 'one-shot' reset at a particular time
//
settings_avg
{
type fieldAverage;
libs ("libfieldFunctionObjects.so");
log on;
enabled true;
executeControl timeStep;
writeControl outputTime;
writeInterval 1;
// restart behaviour
resetOnStartUp true;
resetOnOutput false;
// periodicRestart true;
// restartPeriod 0.002;
// Use the same values for all entries
meanOnly
{
mean on;
prime2Mean off;
base time;
}
fields
(
rho
{
$meanOnly;
}
U
{
$meanOnly;
}
tracer0
{
$meanOnly;
}
);
}
// restartTime:
// - a 'one-shot' reset at a particular time
//
// fields [required]
// Pairs of fields to use for calculating the deviation.
// The fields must already exist on the surfaces.
//
// weightField [optional]
// A scalar or vector field for weighting.
//
// postOperation [optional]
// Modify the results by particular operations.
// (none | sqrt)
// The sqrt operation is useful when determining RMS values.
//
// The 'output/write' control triggers the calculation.
settings_stats
{
type surfaceFieldValue;
libs ("libfieldFunctionObjects.so");
log on;
enabled true;
writeControl timeStep;
writeInterval 1;
writeFields false;
surfaceFormat vtk;
// writeArea true;
// resetOnStartUp true;
// resetOnOutput false;
// periodicRestart true;
// restartPeriod 0.0005;
}
// ************************************************************************* //

View File

@ -0,0 +1,14 @@
// -*- C++ -*-
// ************************************************************************* //
#include "fieldTransfer"
#include "avg-tracer0"
#include "sum-tracer0"
// #include "sum-tracer0Mean"
// #include "averaging.1612" // generate time-averaged fields
// #include "spatialDeviation.1612" // spatial deviation compared to a mean field
// #include "statistics.1612" // transcribe volume fields -> surface
// ************************************************************************* //

View File

@ -0,0 +1,16 @@
// -*- C++ -*-
tracer0
{
type scalarTransport;
libs ("libsolverFunctionObjects.so");
log off;
resetOnStartUp false;
// writeControl outputTime;
// writeInterval 1;
field tracer0;
D 0.001;
}
// ************************************************************************* //

View File

@ -0,0 +1,379 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Which of the steps to run
castellatedMesh true;
snap true;
addLayers false;
// Geometry. Definition of all surfaces. All surfaces are of class
// searchableSurface.
// Surfaces are used
// - to specify refinement for any mesh cell intersecting it
// - to specify refinement for any mesh cell inside/outside/near
// - to 'snap' the mesh boundary to the surface
geometry
{
inlet_air.stl
{
type triSurfaceMesh;
name inlet_air;
}
inlet_fuel.stl
{
type triSurfaceMesh;
name inlet_fuel;
}
outlet.stl
{
type triSurfaceMesh;
name outlet;
}
entrainment.stl
{
type triSurfaceMesh;
name inlet_entrainment;
}
walls.stl
{
type triSurfaceMesh;
name walls;
}
refinementBox
{
type searchableBox;
min (-0.5 -0.125 -0.25);
max (1.5 0.125 0.25);
}
};
// Settings for the castellatedMesh generation.
castellatedMeshControls
{
// Refinement parameters
// ~~~~~~~~~~~~~~~~~~~~~
// If local number of cells is >= maxLocalCells on any processor
// switches from from refinement followed by balancing
// (current method) to (weighted) balancing before refinement.
maxLocalCells 100000;
// Overall cell limit (approximately). Refinement will stop immediately
// upon reaching this number so a refinement level might not complete.
// Note that this is the number of cells before removing the part which
// is not 'visible' from the keepPoint. The final number of cells might
// actually be a lot less.
maxGlobalCells 2000000;
// The surface refinement loop might spend lots of iterations refining just a
// few cells. This setting will cause refinement to stop if <= minimumRefine
// are selected for refinement. Note: it will at least do one iteration
// (unless the number of cells to refine is 0)
minRefinementCells 0;
// Number of buffer layers between different levels.
// 1 means normal 2:1 refinement restriction, larger means slower
// refinement.
nCellsBetweenLevels 5;
// Explicit feature edge refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Specifies a level for any cell intersected by its edges.
// This is a featureEdgeMesh, read from constant/triSurface for now.
features
(
{
file "walls.eMesh";
level 0;
}
);
// Surface based refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~
// Specifies two levels for every surface. The first is the minimum level,
// every cell intersecting a surface gets refined up to the minimum level.
// The second level is the maximum level. Cells that 'see' multiple
// intersections where the intersections make an
// angle > resolveFeatureAngle get refined up to the maximum level.
refinementSurfaces
{
inlet_air
{
level (4 4);
patchInfo
{
type patch;
}
}
inlet_fuel
{
level (6 6);
patchInfo
{
type patch;
}
}
outlet
{
level (4 4);
patchInfo
{
type patch;
}
}
inlet_entrainment
{
level (4 4);
patchInfo
{
type patch;
}
}
walls
{
level (4 4);
regions
{
pipe_fuel { level (6 6); }
}
patchInfo
{
type wall;
inGroups (wall);
}
}
}
resolveFeatureAngle 30;
// Region-wise refinement
// ~~~~~~~~~~~~~~~~~~~~~~
// Specifies refinement level for cells in relation to a surface. One of
// three modes
// - distance. 'levels' specifies per distance to the surface the
// wanted refinement level. The distances need to be specified in
// descending order.
// - inside. 'levels' is only one entry and only the level is used. All
// cells inside the surface get refined up to the level. The surface
// needs to be closed for this to be possible.
// - outside. Same but cells outside.
refinementRegions
{
refinementBox
{
mode inside;
levels ((4 4));
}
}
// Mesh selection
// ~~~~~~~~~~~~~~
// After refinement patches get added for all refinementSurfaces and
// all cells intersecting the surfaces get put into these patches. The
// section reachable from the locationInMesh is kept.
// NOTE: This point should never be on a face, always inside a cell, even
// after refinement.
// This is an outside point locationInMesh (-0.033 -0.033 0.0033);
locationInMesh (0.5 0.01 0.01);
// Whether any faceZones (as specified in the refinementSurfaces)
// are only on the boundary of corresponding cellZones or also allow
// free-standing zone faces. Not used if there are no faceZones.
allowFreeStandingZoneFaces false;
}
// Settings for the snapping.
snapControls
{
//- Number of patch smoothing iterations before finding correspondence
// to surface
nSmoothPatch 3;
//- Relative distance for points to be attracted by surface feature point
// or edge. True distance is this factor times local
// maximum edge length.
tolerance 1.0;
//- Number of mesh displacement relaxation iterations.
nSolveIter 300;
//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 5;
// Feature snapping
//- Number of feature edge snapping iterations.
// Leave out altogether to disable.
nFeatureSnapIter 10;
//- Detect (geometric) features by sampling the surface
implicitFeatureSnap true;
//- Use castellatedMeshControls::features
explicitFeatureSnap false;
//- Detect features between multiple surfaces
// (only for explicitFeatureSnap, default = false)
multiRegionFeatureSnap true;
}
// Settings for the layer addition.
addLayersControls
{
// Are the thickness parameters below relative to the undistorted
// size of the refined cell outside layer (true) or absolute sizes (false).
relativeSizes true;
// Per final patch (so not geometry!) the layer information
layers
{
"blade."
{
nSurfaceLayers 2;
}
}
// Expansion factor for layer mesh
expansionRatio 1.0;
// Wanted thickness of final added cell layer. If multiple layers
// is the thickness of the layer furthest away from the wall.
// Relative to undistorted size of cell outside layer.
// See relativeSizes parameter.
finalLayerThickness 0.25;
// Minimum thickness of cell layer. If for any reason layer
// cannot be above minThickness do not add layer.
// See relativeSizes parameter.
minThickness 0.2;
// If points get not extruded do nGrow layers of connected faces that are
// also not grown. This helps convergence of the layer addition process
// close to features.
nGrow 0;
// Advanced settings
// When not to extrude surface. 0 is flat surface, 90 is when two faces
// are perpendicular
featureAngle 30;
// Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 5;
// Number of smoothing iterations of surface normals
nSmoothSurfaceNormals 1;
// Number of smoothing iterations of interior mesh movement direction
nSmoothNormals 3;
// Smooth layer thickness over surface patches
nSmoothThickness 10;
// Stop layer growth on highly warped cells
maxFaceThicknessRatio 0.5;
// Reduce layer growth where ratio thickness to medial
// distance is large
maxThicknessToMedialRatio 0.3;
// Angle used to pick up medial axis points
minMedianAxisAngle 90;
// Create buffer region for new layer terminations
nBufferCellsNoExtrude 0;
// Overall max number of layer addition iterations. The mesher will exit
// if it reaches this number of iterations; possibly with an illegal
// mesh.
nLayerIter 50;
// Max number of iterations after which relaxed meshQuality controls
// get used. Up to nRelaxIter it uses the settings in meshQualityControls,
// after nRelaxIter it uses the values in meshQualityControls::relaxed.
nRelaxedIter 20;
}
// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
#include "meshQualityDict"
// Optional : some meshing phases allow usage of relaxed rules.
// See e.g. addLayersControls::nRelaxedIter.
relaxed
{
//- Maximum non-orthogonality allowed. Set to 180 to disable.
maxNonOrtho 75;
}
// Advanced
//- Number of error distribution iterations
nSmoothScale 4;
//- amount to scale back displacement at error points
errorReduction 0.75;
}
// Advanced
// Write flags
writeFlags
(
scalarLevels // write volScalarField with cellLevel for postprocessing
layerSets // write cellSets, faceSets of faces in layer
layerFields // write volScalarField for layer coverage
);
// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1E-6;
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
// -*- C++ -*-
// ************************************************************************* //
sum-tracer0-0.25
{
$settings_stats
regionType surface;
name plane-0.25;
operation weightedAreaIntegrate;
// postOperation sqrt;
weightField rhoU;
fields (tracer0);
}
sum-tracer0-0.45
{
$settings_stats
regionType surface;
name plane-0.45;
operation weightedAreaIntegrate;
// postOperation sqrt;
weightField rhoU;
fields (tracer0);
}
sum-tracer0-0.55
{
$settings_stats
regionType surface;
name plane-0.55;
operation weightedAreaIntegrate;
// postOperation sqrt;
weightField rhoU;
fields (tracer0);
}
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object surfaceFeatureExtractDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
walls.stl
{
// How to obtain raw features (extractFromFile || extractFromSurface)
extractionMethod extractFromSurface;
extractFromSurfaceCoeffs
{
// Mark edges whose adjacent surface normals are at an angle less
// than includedAngle as features
// - 0 : selects no edges
// - 180: selects all edges
includedAngle 150;
}
subsetFeatures
{
// Keep nonManifold edges (edges with >2 connected faces)
nonManifoldEdges no;
// Keep open edges (edges with 1 connected face)
openEdges yes;
}
// Write options
// Write features to obj format for postprocessing
writeObj yes;
}
// ************************************************************************* //