Commit 581d3b47 authored by Chris Greenshields's avatar Chris Greenshields
Browse files

Template inflow-outflow case for compressible flow with rhoSimpleFoam

parent 913103ec
/*--------------------------------*- 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"
}
// ************************************************************************* //
/*--------------------------------*- 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"
}
// ************************************************************************* //
/*--------------------------------*- 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"
}
// ************************************************************************* //
/*--------------------------------*- 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"
}
// ************************************************************************* //
/*--------------------------------*- 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"
}
// ************************************************************************* //
/*--------------------------------*- 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"
}
// ************************************************************************* //
/*--------------------------------*- 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"
}
// ************************************************************************* //
/*--------------------------------*- 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"
}
// ************************************************************************* //
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
\ No newline at end of file
/*--------------------------------*- 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;
// ************************************************************************* //
/*--------------------------------*- 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
(
);
// ************************************************************************* //
/*--------------------------------*- 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;