Merge branch 'master' of github.com:OpenFOAM/OpenFOAM-dev

This commit is contained in:
Henry Weller
2015-08-07 15:53:45 +01:00
21 changed files with 1087 additions and 0 deletions

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 volScalarField;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Tinlet 500;
Tout 298; // Used for fixedValue boundary condition on walls
dimensions [0 0 0 1 0 0 0];
internalField uniform $Tinlet;
boundaryField
{
inlet
{
type fixedValue;
value uniform $Tinlet;
}
outlet
{
type inletOutlet;
inletValue uniform $Tout;
value $inletValue;
}
wall
{
type fixedValue;
value uniform $Tout;
}
#includeEtc "caseDicts/setConstraintTypes"
}
// ************************************************************************* //

View File

@ -0,0 +1,46 @@
/*--------------------------------*- 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 volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Uinlet (10 0 0);
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform $Uinlet;
}
outlet
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}
wall
{
type fixedValue;
value uniform (0 0 0);
}
#includeEtc "caseDicts/setConstraintTypes"
}
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- 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 volScalarField;
object alphat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value uniform 0;
}
outlet
{
type calculated;
value uniform 0;
}
wall
{
type compressible::alphatWallFunction;
value uniform 0;
}
#includeEtc "caseDicts/setConstraintTypes"
}
// ************************************************************************* //

View File

@ -0,0 +1,47 @@
/*--------------------------------*- 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 volScalarField;
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
epsilonInlet 0.001;
dimensions [0 2 -3 0 0 0 0];
internalField uniform $epsilonInlet;
boundaryField
{
inlet
{
type compressible::turbulentMixingLengthDissipationRateInlet;
mixingLength 0.05;
value uniform $epsilonInlet;
}
outlet
{
type inletOutlet;
inletValue uniform $epsilonInlet;
value uniform $epsilonInlet;
}
wall
{
type compressible::epsilonWallFunction;
value uniform $epsilonInlet;
}
#includeEtc "caseDicts/setConstraintTypes"
}
// ************************************************************************* //

View File

@ -0,0 +1,47 @@
/*--------------------------------*- 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 volScalarField;
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
kInlet 0.1;
dimensions [0 2 -2 0 0 0 0];
internalField uniform $kInlet;
boundaryField
{
inlet
{
type fixedValue;
value uniform $kInlet;
}
outlet
{
type inletOutlet;
inletValue uniform $kInlet;
value uniform $kInlet;
}
wall
{
type compressible::kqRWallFunction;
value uniform $kInlet;
}
#includeEtc "caseDicts/setConstraintTypes"
}
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- 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 volScalarField;
object mut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value uniform 0;
}
outlet
{
type calculated;
value uniform 0;
}
wall
{
type nutkWallFunction;
value uniform 0;
}
#includeEtc "caseDicts/setConstraintTypes"
}
// ************************************************************************* //

View File

@ -0,0 +1,47 @@
/*--------------------------------*- 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 volScalarField;
object omega;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
omegaInlet 1.0;
dimensions [0 0 -1 0 0 0 0];
internalField uniform $omegaInlet;
boundaryField
{
inlet
{
type fixedValue;
value uniform $omegaInlet;
}
outlet
{
type inletOutlet;
inletValue uniform $omegaInlet;
value uniform $omegaInlet;
}
wall
{
type compressible::omegaWallFunction;
value uniform $omegaInlet;
}
#includeEtc "caseDicts/setConstraintTypes"
}
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- 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 volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
pOut 1.0e5;
dimensions [1 -1 -2 0 0 0 0];
internalField uniform $pOut;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform $pOut;
}
wall
{
type zeroGradient;
}
#includeEtc "caseDicts/setConstraintTypes"
}
// ************************************************************************* //

View File

@ -0,0 +1,54 @@
Overview
========
+ This is a template case with single inlet and outlet
+ Setup to run the compressible rhoSimpleFoam solver
+ The case is designed to be meshed with snappyHexMesh
+ snappyHexMesh is setup to use a single trisurface file named CAD.obj
+ Copy the CAD.obj file to the constant/triSurface directory
+ The CAD.obj should contain an inlet and outlet region to create the relevant
patches in the mesh
Background Mesh
===============
+ The user should establish the bounds of their CAD.obj file
+ The blockMeshDict file contains a backgroundMesh subditionary
+ Set xMin, xMax, etc to be beyond the CAD.obj bounds
+ Set background mesh density with xCells, yCells, zCells
+ Run blockMesh
Background Mesh (alternative)
=============================
+ The user can adopt the background mesh patches in the mesh
+ For example, the background mesh can provide external patches of an external
flow
+ An alternative blockMeshDict file is set up for this: blockMeshDict.extPatches
+ Simply copy blockMeshDict.extPatches to blockMeshDict and edit inlet, outlet
patches accordingly
Castellated Mesh
================
+ In the snappyHexMeshDict file, replace <inletPatch> with the name of the inlet
region in the CAD.obj file
+ Replace <outletPatch> with the name of the outlet region
+ run snappyHexMesh to obtain a castellatedMesh
+ Review the mesh; modify refinement levels and regenerate the mesh as required
(levels are set in refinementSurfaces and refinementRegions)
Snapped Mesh
============
+ In snappyHexMeshDict, set castellatedMesh off; snap on;
+ Run the snapping phase of snappyHexMesh
+ Review the mesh
Layers
======
+ To add layers to the mesh along wall boundary patches...
+ Switch on addLayers; switch snap off;
+ Run snappyHexMesh
+ The number of layers can be changed by modifying nSurfaceLayers
Initialisation
==============
+ In the field files in the 0 directory, set inlet values
+ For example, in 0/U, set the inlet velocity Uinlet
+ Set the viscosity in constant/transportProperties

View File

@ -0,0 +1,23 @@
/*--------------------------------*- 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 RASProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
RASModel kEpsilon;
turbulence on;
printCoeffs on;
// ************************************************************************* //

View File

@ -0,0 +1,68 @@
/*--------------------------------*- 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 blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
backgroundMesh
{
xMin -1;
xMax 1;
yMin -1;
yMax 1;
zMin -1;
zMax 1;
xCells 20;
yCells 20;
zCells 20;
}
convertToMeters 1;
vertices
(
($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMin)
($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMin)
($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMin)
($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMin)
($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMax)
($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMax)
($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMax)
($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMax)
);
blocks
(
hex (0 1 2 3 4 5 6 7)
(
$:backgroundMesh.xCells
$:backgroundMesh.yCells
$:backgroundMesh.zCells
)
simpleGrading (1 1 1)
);
edges
(
);
boundary
(
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1,121 @@
/*--------------------------------*- 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 blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
backgroundMesh
{
xMin -1;
xMax 1;
yMin -1;
yMax 1;
zMin -1;
zMax 1;
xCells 20;
yCells 20;
zCells 20;
}
convertToMeters 1;
vertices
(
($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMin)
($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMin)
($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMin)
($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMin)
($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMax)
($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMax)
($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMax)
($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMax)
);
blocks
(
hex (0 1 2 3 4 5 6 7)
(
$:backgroundMesh.xCells
$:backgroundMesh.yCells
$:backgroundMesh.zCells
)
simpleGrading (1 1 1)
);
edges
(
);
boundary
(
left
{
type patch;
faces
(
(0 3 7 4)
);
}
right
{
type patch;
faces
(
(1 5 6 2)
);
}
bottom
{
type patch;
faces
(
(0 1 2 3)
);
}
top
{
type patch;
faces
(
(4 7 6 5)
);
}
back
{
type patch;
faces
(
(0 4 5 1)
);
}
front
{
type patch;
faces
(
(3 2 6 7)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

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;
location "constant";
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
{
type hePsiThermo;
mixture pureMixture;
transport const;
thermo hConst;
equationOfState perfectGas;
specie specie;
energy sensibleInternalEnergy;
}
mixture // air at room temperature (293 K)
{
specie
{
nMoles 1;
molWeight 28.9;
}
thermodynamics
{
Cp 1005;
Hf 0;
}
transport
{
mu 1.82e-05;
Pr 0.71;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,19 @@
/*--------------------------------*- 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 turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RASModel;
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*--------------------------------*- 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 controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhoSimpleFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 1000;
deltaT 1;
writeControl timeStep;
writeInterval 50;
purgeWrite 0;
writeFormat ascii;
writePrecision 8;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
functions
{
}
// ************************************************************************* //

View File

@ -0,0 +1,76 @@
/*--------------------------------*- 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 fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default steadyState;
}
gradSchemes
{
default Gauss linear;
limited cellLimited Gauss linear 1;
grad(U) $limited;
grad(k) $limited;
grad(omega) $limited;
grad(epsilon) $limited;
}
divSchemes
{
default none;
div(phi,U) bounded Gauss linearUpwind limited;
turbulence bounded Gauss limitedLinear 1;
div(phi,k) $turbulence;
div(phi,omega) $turbulence;
div(phi,epsilon) $turbulence;
div(phi,e) $turbulence;
div(phi,h) $turbulence;
div(phi,K) $turbulence;
div(phi,Ekp) $turbulence;
div(phid,p) bounded Gauss upwind;
div((phi|interpolate(rho)),p) bounded Gauss upwind;
div((muEff*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p ;
}
// ************************************************************************* //

View File

@ -0,0 +1,69 @@
/*--------------------------------*- 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 fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p
{
solver GAMG;
smoother GaussSeidel;
cacheAgglomeration on; // Need to make this default?
agglomerator faceAreaPair; // Need to make this default?
nCellsInCoarsestLevel 10; // Need to make this default?
mergeLevels 1; // Need to make this default
tolerance 1e-6;
relTol 0.1;
}
"(U|k|omega|epsilon|e|h)"
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-6;
relTol 0.1;
}
}
SIMPLE
{
residualControl
{
p 1e-4;
U 1e-4;
"(k|omega|epsilon|e|h)" 1e-4;
}
nNonOrthogonalCorrectors 0;
rhoMin rhoMin [ 1 -3 0 0 0 ] 0.1;
rhoMax rhoMax [ 1 -3 0 0 0 ] 1.5;
}
relaxationFactors
{
fields
{
p 0.3;
rho 0.01;
}
equations
{
U 0.7;
"(e|h)" 0.7;
"(k|epsilon|omega)" 0.7;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,22 @@
/*--------------------------------*- 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 meshQualityDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#includeEtc "caseDicts/mesh/generation/meshQualityDict.cfg"
//- minFaceWeight (0 -> 0.5)
//minFaceWeight 0.02;
// ************************************************************************* //

View File

@ -0,0 +1,128 @@
/*--------------------------------*- 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 snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#includeEtc "caseDicts/mesh/generation/snappyHexMeshDict.cfg"
castellatedMesh on;
snap off;
addLayers off;
geometry
{
CAD.obj
{
type triSurfaceMesh;
name CAD;
regions
{
<inletPatch> { name inlet; }
<outletPatch> { name outlet; }
}
}
};
castellatedMeshControls
{
features
(
// { file "CAD.eMesh"; level 1; }
);
refinementSurfaces
{
CAD
{
level (2 2);
patchInfo { type wall; }
regions
{
<inletPatch>
{
level (2 2);
patchInfo
{
type patch;
inGroups (inlet);
}
}
<outletPatch>
{
level (2 2);
patchInfo
{
type patch;
inGroups (outlet);
}
}
}
}
}
refinementRegions
{
CAD
{
mode inside;
levels ((1E15 2));
}
}
locationInMesh (1e-5 1e-5 1e-5); // Offset from (0 0 0) to avoid
// coinciding with face or edge
}
snapControls
{
// explicitFeatureSnap true;
// implicitFeatureSnap false;
}
addLayersControls
{
layers
{
"CAD.*"
{
nSurfaceLayers 2;
}
}
relativeSizes true; // false, usually with firstLayerThickness
expansionRatio 1.2;
finalLayerThickness 0.5;
minThickness 1e-3;
// firstLayerThickness 0.01;
// maxThicknessToMedialRatio 0.6;
}
meshQualityControls
{
// minTetQuality -1e+30;
}
writeFlags
(
scalarLevels
layerSets
layerFields
);
mergeTolerance 1e-6;
// ************************************************************************* //

View File

@ -0,0 +1,41 @@
/*--------------------------------*- 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;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
CAD.obj
{
extractionMethod extractFromSurface;
extractFromSurfaceCoeffs
{
includedAngle 150;
}
subsetFeatures
{
nonManifoldEdges yes;
openEdges yes;
}
trimFeatures
{
minElem 0;
minLen 0;
}
writeObj yes;
}
// ************************************************************************* //