From 44304e07d6d6ded94112b2aaabf26e62f51b4fc1 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 3 Dec 2019 12:34:50 +0100 Subject: [PATCH] TUT: simple tutorial with expression boundary conditions and setExprFields --- .../rhoPimpleFoam/RAS/TJunctionAverage/0/T | 55 ++++++++ .../rhoPimpleFoam/RAS/TJunctionAverage/0/U | 50 +++++++ .../RAS/TJunctionAverage/0/alphat | 50 +++++++ .../RAS/TJunctionAverage/0/epsilon | 53 ++++++++ .../rhoPimpleFoam/RAS/TJunctionAverage/0/k | 51 +++++++ .../RAS/TJunctionAverage/0/nuTilda | 44 ++++++ .../rhoPimpleFoam/RAS/TJunctionAverage/0/nut | 50 +++++++ .../rhoPimpleFoam/RAS/TJunctionAverage/0/p | 71 ++++++++++ .../RAS/TJunctionAverage/README.txt | 4 + .../RAS/TJunctionAverage/constant/fvOptions | 22 +++ .../constant/thermophysicalProperties | 48 +++++++ .../constant/turbulenceProperties | 30 +++++ .../RAS/TJunctionAverage/system/blockMeshDict | 127 ++++++++++++++++++ .../RAS/TJunctionAverage/system/controlDict | 52 +++++++ .../RAS/TJunctionAverage/system/fvSchemes | 57 ++++++++ .../RAS/TJunctionAverage/system/fvSolution | 70 ++++++++++ .../system/setExprBoundaryFieldsDict | 32 +++++ .../TJunctionAverage/system/setExprFieldsDict | 53 ++++++++ 18 files changed, 919 insertions(+) create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/T create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/U create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/alphat create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/epsilon create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/k create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/nuTilda create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/nut create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/p create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/README.txt create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/constant/fvOptions create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/constant/thermophysicalProperties create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/constant/turbulenceProperties create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/blockMeshDict create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/controlDict create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/fvSchemes create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/fvSolution create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/setExprBoundaryFieldsDict create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/setExprFieldsDict diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/T b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/T new file mode 100644 index 0000000000..166a338f30 --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/T @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: 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 outletMappedUniformInletHeatAddition; + outletPatch outlet1; + Q 5; // Heat addition in W + TMin 300; + TMax 500; + value $internalField; + } + + outlet1 + { + type inletOutlet; + inletValue $internalField; + value $internalField; + } + + outlet2 + { + type inletOutlet; + inletValue $internalField; + value $internalField; + } + + defaultFaces + { + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/U b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/U new file mode 100644 index 0000000000..60b7f0d8f0 --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/U @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + inlet + { + type pressureInletOutletVelocity; + value uniform (0 0 0); + } + + outlet1 + { + type inletOutlet; + inletValue uniform (0 0 0); + value uniform (0 0 0); + } + + outlet2 + { + type inletOutlet; + inletValue uniform (0 0 0); + value uniform (0 0 0); + } + + defaultFaces + { + type fixedValue; + value uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/alphat b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/alphat new file mode 100644 index 0000000000..6471c69006 --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/alphat @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: 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 uniform 0; + } + + outlet1 + { + type calculated; + value uniform 0; + } + + outlet2 + { + type calculated; + value uniform 0; + } + + defaultFaces + { + type compressible::alphatWallFunction; + value $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/epsilon b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/epsilon new file mode 100644 index 0000000000..3f577a7999 --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/epsilon @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: 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 200; + +boundaryField +{ + inlet + { + type turbulentMixingLengthDissipationRateInlet; + mixingLength 0.01; // 1cm - half channel height + value $internalField; + } + + outlet1 + { + type inletOutlet; + inletValue $internalField; + value $internalField; + } + + outlet2 + { + type inletOutlet; + inletValue $internalField; + value $internalField; + } + + defaultFaces + { + type epsilonWallFunction; + value $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/k b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/k new file mode 100644 index 0000000000..1e041613e9 --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/k @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: 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 1; + +boundaryField +{ + inlet + { + type turbulentIntensityKineticEnergyInlet; + intensity 0.05; // 5% turbulent intensity + value $internalField; + } + + outlet1 + { + type inletOutlet; + inletValue $internalField; + } + + outlet2 + { + type inletOutlet; + inletValue $internalField; + } + + defaultFaces + { + type kqRWallFunction; + value $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/nuTilda b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/nuTilda new file mode 100644 index 0000000000..dc39c62165 --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/nuTilda @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object nuTilda; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type zeroGradient; + } + + outlet1 + { + type zeroGradient; + } + + outlet2 + { + type zeroGradient; + } + + defaultFaces + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/nut b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/nut new file mode 100644 index 0000000000..1552d4d85c --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/nut @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: 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 uniform 0; + } + + outlet1 + { + type calculated; + value uniform 0; + } + + outlet2 + { + type calculated; + value uniform 0; + } + + defaultFaces + { + type nutkWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/p b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/p new file mode 100644 index 0000000000..1e896e6508 --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/p @@ -0,0 +1,71 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + inlet + { + type uniformTotalPressure; + gamma 1.2; + + p0 table + ( + (0 1e5) + (1 1.4e5) + ); + } + + outlet1 + { + type fixedValue; + value $internalField; + } + + outlet1 + { + type exprFixedValue; + value $internalField; + + valueExpr "0.5*(pInlet + pOutlet2)"; + variables + ( + "pInlet{inlet} = weightAverage(p)" + "pOutlet2{outlet2} = p" + ); + + // debug true; + // debugScanner true; + // debugParser true; + } + + + outlet2 + { + type fixedValue; + value $internalField; + } + + defaultFaces + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/README.txt b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/README.txt new file mode 100644 index 0000000000..5c812a1e4b --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/README.txt @@ -0,0 +1,4 @@ +15/8/8 Simple T-junction. Inlet on left, one outlet at bottom, one at top. +To test multiple outlets. + +Enable debugScanner/debugParser for a verbose view of the parsing engine. diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/constant/fvOptions b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/constant/fvOptions new file mode 100644 index 0000000000..ce5c49527b --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/constant/fvOptions @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object fvOptions; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +viscousDissipation +{ + type viscousDissipation; + enabled true; +} +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/constant/thermophysicalProperties b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/constant/thermophysicalProperties new file mode 100644 index 0000000000..356422609d --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/constant/thermophysicalProperties @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: 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 sensibleEnthalpy; +} + +mixture +{ + specie + { + molWeight 28.9; + } + thermodynamics + { + Cp 1007; + Hf 0; + } + transport + { + As 1.4792e-06; + Ts 116; + } +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/constant/turbulenceProperties b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/constant/turbulenceProperties new file mode 100644 index 0000000000..f728d3fb7c --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/constant/turbulenceProperties @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: 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; +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/blockMeshDict b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/blockMeshDict new file mode 100644 index 0000000000..ed28fc6988 --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/blockMeshDict @@ -0,0 +1,127 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// outlet1 +// +-+ +// | | +// | | +// | | +// | | +// +-----------+ | +// |inlet | +// +-----------+ | +// | | +// | | +// | | +// | | +// +-+ +// outlet2 + +scale 1; + +vertices +( + (0.0 -0.01 0) //0 + (0.2 -0.01 0) + (0.2 0.01 0) //2 + (0.0 0.01 0) + + (0.22 -0.01 0) //4 + (0.22 0.01 0) + + (0.2 -0.21 0) //6 + (0.22 -0.21 0) + + (0.2 0.21 0) //8 + (0.22 0.21 0) + + // Z + (0.0 -0.01 0.02) //0 + (0.2 -0.01 0.02) + (0.2 0.01 0.02) //2 + (0.0 0.01 0.02) + + (0.22 -0.01 0.02) //4 + (0.22 0.01 0.02) + + (0.2 -0.21 0.02) //6 + (0.22 -0.21 0.02) + + (0.2 0.21 0.02) //8 + (0.22 0.21 0.02) + +); + +blocks +( + // inlet block + hex (0 1 2 3 10 11 12 13) (50 5 5) simpleGrading (1 1 1) + + // central block + hex (1 4 5 2 11 14 15 12) (5 5 5) simpleGrading (1 1 1) + + // bottom block + hex (6 7 4 1 16 17 14 11) (5 50 5) simpleGrading (1 1 1) + + // top block + hex (2 5 9 8 12 15 19 18) (5 50 5) simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + inlet + { + type patch; + faces + ( + (0 10 13 3) + ); + } + + outlet1 + { + type patch; + faces + ( + (6 7 17 16) + ); + } + + outlet2 + { + type patch; + faces + ( + (8 18 19 9) + ); + } + + defaultFaces + { + type wall; + faces (); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/controlDict b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/controlDict new file mode 100644 index 0000000000..02148db3cc --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/controlDict @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application rhoPimpleFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 1.0; + +deltaT 0.001; + +writeControl adjustable; + +writeInterval 0.1; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +adjustTimeStep yes; + +maxCo 3; + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/fvSchemes b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/fvSchemes new file mode 100644 index 0000000000..26d7a69489 --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/fvSchemes @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss limitedLinearV 1; + div(phi,k) Gauss limitedLinear 1; + div(phi,epsilon) Gauss limitedLinear 1; + div(phi,h) Gauss limitedLinear 1; + div(phi,R) Gauss limitedLinear 1; + div(R) Gauss linear; + div(phi,K) Gauss linear; + div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/fvSolution b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/fvSolution new file mode 100644 index 0000000000..82ea2a0025 --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/fvSolution @@ -0,0 +1,70 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver GAMG; + tolerance 1e-08; + relTol 0.01; + smoother GaussSeidel; + } + + pFinal + { + solver GAMG; + tolerance 1e-08; + relTol 0; + smoother GaussSeidel; + } + + "(rho|U|k|epsilon|h)" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-07; + relTol 0.05; + } + + "(rho|U|k|epsilon|h)Final" + { + $U; + tolerance 1e-07; + relTol 0; + } +} + +PIMPLE +{ + momentumPredictor no; + transonic no; + nOuterCorrectors 1; + nCorrectors 5; + nNonOrthogonalCorrectors 0; +} + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/setExprBoundaryFieldsDict b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/setExprBoundaryFieldsDict new file mode 100644 index 0000000000..6412e4f64b --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/setExprBoundaryFieldsDict @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object setExprBoundaryFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +pattern +{ + field T; + + expressions + ( + { + patch outlet2; + target something; + expression #{ (pos().x() < 1e-4 ? 60 : 120) #}; + } + ); +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/setExprFieldsDict b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/setExprFieldsDict new file mode 100644 index 0000000000..1a124966e7 --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/system/setExprFieldsDict @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1912 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object setExprFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +expressions +( + T + { + field T; + dimensions [0 0 0 1 0 0 0]; + + constants + { + centre (0.21 0 0.01); + } + + variables + ( + "radius = 0.1" + ); + + condition + #{ + // Within the radius + (mag(pos() - $[(vector)constants.centre]) < radius) + + // but only +ve y! + && pos((pos() - $[(vector)constants.centre]).y()) > 0 + #}; + + expression + #{ + 300 + + 200 * (1 - mag(pos() - $[(vector)constants.centre]) / radius) + #}; + } +); + + +// ************************************************************************* //