diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/T b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/T new file mode 100644 index 0000000000..9fc32c4470 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/T @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 297; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + inletValue $internalField; + value $internalField; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + type compressible::turbulentTemperatureCoupledBaffleMixed; + kappa kappa; + Tnbr T; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/U b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/U new file mode 100644 index 0000000000..f50b9032f1 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/U @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Uinlet (0.1 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 $internalField; + } + + topAndBottom + { + type slip; + } + + wall + { + type noSlip; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/alphat b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/alphat new file mode 100644 index 0000000000..9b47b24454 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/alphat @@ -0,0 +1,43 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ 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|outlet)" + { + type calculated; + value uniform 0; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + type compressible::alphatWallFunction; + value uniform 0; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/k b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/k new file mode 100644 index 0000000000..3c77f262ad --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/k @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +kInlet 0.02; +intensityInlet 0.01; + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.02; + +boundaryField +{ + inlet + { + type turbulentIntensityKineticEnergyInlet; + intensity 0.01; + value $internalField; + } + + outlet + { + type inletOutlet; + inletValue $internalField; + value $internalField; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + type kqRWallFunction; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/nut b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/nut new file mode 100644 index 0000000000..4260b36d8b --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/nut @@ -0,0 +1,43 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + "(inlet|outlet)" + { + type calculated; + value uniform 0; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + type nutkWallFunction; + value uniform 0; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/omega b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/omega new file mode 100644 index 0000000000..fe92767122 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/omega @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object omega; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 -1 0 0 0 0]; + +internalField uniform 10; + +boundaryField +{ + inlet + { + type turbulentMixingLengthFrequencyInlet; + mixingLength 0.0035; + value $internalField; + } + + outlet + { + type inletOutlet; + inletValue $internalField; + value $internalField; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + type omegaWallFunction; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/p b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/p new file mode 100644 index 0000000000..edc39e3f6f --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/p @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ 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|outlet)" + { + type calculated; + value $internalField; + } + + outlet + { + type calculated; + value $internalField; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + $inlet; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/p_rgh b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/p_rgh new file mode 100644 index 0000000000..3bc86589c5 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/fluid/p_rgh @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 1 -1 -2 0 0 0 0 ]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type fixedFluxPressure; + value uniform 0; + } + + outlet + { + type fixedValue; + value uniform 0; + } + + topAndBottom + { + type zeroGradient; + } + + wall + { + $inlet; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/solid/T b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/solid/T new file mode 100644 index 0000000000..f90eca0d7a --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/0/solid/T @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 0 0 1 0 0 0 ]; + +internalField uniform 297; + +boundaryField +{ + wall + { + type compressible::turbulentTemperatureCoupledBaffleMixed; + kappa kappa; + Tnbr T; + value $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/Allclean b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/Allclean new file mode 100755 index 0000000000..1bde0494fc --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/Allclean @@ -0,0 +1,14 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase + +rm -f 0/cellToRegion + +for region in fluid solid +do + rm -rf 0/${region}/cellToRegion constant/${region}/polyMesh +done diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/Allrun b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/Allrun new file mode 100755 index 0000000000..3a32b979e5 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/Allrun @@ -0,0 +1,18 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication blockMesh + +runApplication topoSet + +runApplication splitMeshRegions -cellZones -defaultRegionName fluid -overwrite + +paraFoam -region fluid -touch +paraFoam -region solid -touch + +runApplication $(getApplication) + +#------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/fluid/g b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/fluid/g new file mode 100644 index 0000000000..e82985fe6b --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/fluid/g @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 -9.81 0); + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/fluid/momentumTransport b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/fluid/momentumTransport new file mode 100644 index 0000000000..9673616d65 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/fluid/momentumTransport @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object momentumTransport; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + model kOmegaSST; + + turbulence on; + printCoeffs on; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/fluid/pRef b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/fluid/pRef new file mode 100644 index 0000000000..6ff4da0e04 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/fluid/pRef @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedScalarField; + location "constant"; + object pRef; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; +value 1e5; + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/fluid/thermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/fluid/thermophysicalProperties new file mode 100644 index 0000000000..d4cfc062f2 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/fluid/thermophysicalProperties @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo eConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + nMoles 1; + molWeight 18; // [g/mol] + } + equationOfState + { + rho 998.19; // [kg/m^3] + } + thermodynamics + { + Cv 4150; // [J/kg/K] + Hf 0; + } + transport + { + mu 1.0005e-3; // [kg/m/s] + Pr 6.31; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/fluid/thermophysicalTransport b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/fluid/thermophysicalTransport new file mode 100644 index 0000000000..b8802a163b --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/fluid/thermophysicalTransport @@ -0,0 +1,26 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalTransport; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RAS +{ + model eddyDiffusivity; + + Prt 0.85; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/regionProperties b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/regionProperties new file mode 100644 index 0000000000..ba8a7ddddb --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/regionProperties @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object regionProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +regions +( + fluid ( fluid ) + solid ( solid ) +); + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/solid/fvOptions b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/solid/fvOptions new file mode 100644 index 0000000000..c9af3a6c03 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/solid/fvOptions @@ -0,0 +1,34 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvOptions; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +cylinderHeat +{ + type semiImplicitSource; + selectionMode all; + volumeMode specific; + power 5e7; + + sources + { + e + { + explicit $power; + implicit 0; + } + } +} + +//************************************************************************** // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/solid/thermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/solid/thermophysicalProperties new file mode 100644 index 0000000000..b69d68b494 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/constant/solid/thermophysicalProperties @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heSolidThermo; + mixture pureMixture; + transport constIso; + thermo eConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + nMoles 1; + molWeight 63.5; // [g/mol] + } + + transport + { + kappa 380; // [W/m/K] + } + + thermodynamics + { + Hf 0; + Cv 385; // [J/kg/K] + } + + equationOfState + { + rho 8940; // [kg/m^3] + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/blockMeshDict b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/blockMeshDict new file mode 100644 index 0000000000..95a3a26ba9 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/blockMeshDict @@ -0,0 +1,194 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +cylinderRadius 0.005; // Radius of the cylinder +halfWidth 0.04; // Half the width of the domain +halfThickness 0.0025; // Half of domain thickness +xMax 0.1; // Maximum size of outer box in streamwise direction +cylinderBox 0.002; // Half width of box projected outwards onto the + // cylinder + +cylinderBoxCells 15; // Cells across cylinder +cylinderRadialCells 12; // Cells cylinder radially +upstreamCells 30; // Cells across width of outer box +downstreamCells 20; // Cells downstream of the cylinder + +radialGrading 20; // Expansion ratio in outer region, radial direction + +negHalfWidth #neg $halfWidth; +negHalfThickness #neg $halfThickness; +negSphereBox #neg $cylinderBox; + + +geometry +{ + cylinder + { + type searchableCylinder; + point1 (0 0 -100); + point2 (0 0 100); + radius $cylinderRadius; + } +} + +vertices +( + project ($negSphereBox $negSphereBox $negHalfThickness) (cylinder) // 0 + project ($cylinderBox $negSphereBox $negHalfThickness) (cylinder) // 1 + project ($negSphereBox $negSphereBox $halfThickness ) (cylinder) // 2 + project ($cylinderBox $negSphereBox $halfThickness ) (cylinder) // 3 + + project ($negSphereBox $cylinderBox $negHalfThickness) (cylinder) // 4 + project ($cylinderBox $cylinderBox $negHalfThickness) (cylinder) // 5 + project ($negSphereBox $cylinderBox $halfThickness ) (cylinder) // 6 + project ($cylinderBox $cylinderBox $halfThickness ) (cylinder) // 7 + + ($negHalfWidth $negHalfWidth $negHalfThickness) // 8 + ($halfWidth $negHalfWidth $negHalfThickness) // 9 + ($negHalfWidth $negHalfWidth $halfThickness ) // 10 + ($halfWidth $negHalfWidth $halfThickness ) // 11 + + ($negHalfWidth $halfWidth $negHalfThickness) // 12 + ($halfWidth $halfWidth $negHalfThickness) // 13 + ($negHalfWidth $halfWidth $halfThickness ) // 14 + ($halfWidth $halfWidth $halfThickness ) // 15 + + ($xMax $negHalfWidth $negHalfThickness) // 16 + ($xMax $negHalfWidth $halfThickness ) // 17 + ($xMax $halfWidth $negHalfThickness) // 18 + ($xMax $halfWidth $halfThickness ) // 19 + + ($negSphereBox $negSphereBox $negHalfThickness) // 20 + ($cylinderBox $negSphereBox $negHalfThickness) // 21 + ($cylinderBox $negSphereBox $halfThickness ) // 22 + ($negSphereBox $negSphereBox $halfThickness ) // 23 + + ($negSphereBox $cylinderBox $negHalfThickness) // 24 + ($cylinderBox $cylinderBox $negHalfThickness) // 25 + ($cylinderBox $cylinderBox $halfThickness ) // 26 + ($negSphereBox $cylinderBox $halfThickness ) // 27 +); + +expandBlock simpleGrading (1 $radialGrading 1); +reg simpleGrading (1 1 1); + +blocks +( + // Fluid region + hex (4 6 14 12 0 2 10 8) (1 $upstreamCells $cylinderBoxCells) $expandBlock + hex (7 5 13 15 3 1 9 11) (1 $upstreamCells $cylinderBoxCells) $expandBlock + hex (2 3 11 10 0 1 9 8) ($cylinderBoxCells $upstreamCells 1) $expandBlock + hex (7 6 14 15 5 4 12 13) ($cylinderBoxCells $upstreamCells 1) $expandBlock + hex (13 18 19 15 9 16 17 11) ($downstreamCells 1 $cylinderBoxCells) $reg + + // Solid region + hex (24 25 26 27 20 21 22 23) ($cylinderBoxCells 1 $cylinderBoxCells) $reg + hex (0 2 23 20 4 6 27 24) (1 $cylinderRadialCells $cylinderBoxCells) $reg + hex (21 22 3 1 25 26 7 5) (1 $cylinderRadialCells $cylinderBoxCells) $reg + hex (0 2 3 1 20 23 22 21) (1 $cylinderBoxCells $cylinderRadialCells) $reg + hex (4 5 7 6 24 25 26 27) ($cylinderBoxCells 1 $cylinderRadialCells) $reg + +); + +edges +( + project 0 2 (cylinder) + project 2 3 (cylinder) + project 3 1 (cylinder) + project 1 0 (cylinder) + project 4 6 (cylinder) + project 6 7 (cylinder) + project 7 5 (cylinder) + project 5 4 (cylinder) + project 0 4 (cylinder) + project 2 6 (cylinder) + project 3 7 (cylinder) + project 1 5 (cylinder) +); + +faces +( +); + +boundary +( + inlet + { + type patch; + faces + ( + (8 10 14 12) + ); + } + + outlet + { + type patch; + faces + ( + (16 17 19 18) + ); + } + + topAndBottom + { + type patch; + faces + ( + (8 9 11 10) + (12 13 15 14) + (9 16 17 11) + (13 18 19 15) + ); + } + + frontAndBack + { + type empty; + faces + ( + // Side 1 + (10 14 6 2) + (14 6 7 15) + (15 7 3 11) + (3 11 10 2) + (15 11 17 19) + (6 7 27 26) + (27 6 2 23) + (2 23 22 3) + (3 22 26 7) + (26 27 23 22) + + // Side 2 + (12 13 5 4) + (8 12 4 0) + (9 8 0 1) + (13 9 1 5) + (4 5 25 24) + (0 4 24 20) + (1 0 20 21) + (5 1 21 25) + (21 20 24 25) + (18 16 9 13) + ); + } +); + + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/controlDict b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/controlDict new file mode 100644 index 0000000000..ac5534a88c --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/controlDict @@ -0,0 +1,61 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application chtMultiRegionFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 20; + +deltaT 0.01; + +writeControl adjustableRunTime; + +writeInterval 0.1; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 8; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +adjustTimeStep no; + +maxCo 5; + +maxDi 200; + +maxDeltaT 1; + +functions +{ + #includeFunc "patchAverage(funcName=cylinderT, region=fluid, name=fluid_to_solid, field=T)" + #includeFunc "patchAverage(funcName=inletU, region=fluid, name=inlet, field=U)" +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/fluid/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/fluid/fvSchemes new file mode 100644 index 0000000000..481c43d8ff --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/fluid/fvSchemes @@ -0,0 +1,74 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; + + limited cellLimited Gauss linear 1; + grad(U) $limited; + grad(k) $limited; + grad(omega) $limited; +} + +divSchemes +{ + default none; + + div(phi,U) Gauss linearUpwind limited; + + turbulence Gauss limitedLinear 1; + div(phi,k) $turbulence; + div(phi,omega) $turbulence; + div(phi,e) $turbulence; + div(phi,K) $turbulence; + + div(phiv,p) Gauss upwind; + div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p ; +} + +wallDist +{ + method meshWave; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/fluid/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/fluid/fvSolution new file mode 100644 index 0000000000..462e308214 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/fluid/fvSolution @@ -0,0 +1,76 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "(rho|rhoFinal)" + { + solver PCG + preconditioner DIC; + tolerance 1e-7; + relTol 0; + } + + p_rgh + { + solver GAMG; + tolerance 1e-7; + relTol 0.01; + + smoother GaussSeidel; + + + maxIter 100; + } + + "(U|e|k|omega)" + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-6; + relTol 0.1; + } + + p_rghFinal + { + $p_rgh; + relTol 0; + } + + "(U|e|k|omega)Final" + { + $U; + relTol 0; + } +} + +PIMPLE +{ + nCorrectors 2; + nNonOrthogonalCorrectors 1; + pRefCell 0; + pRefValue 0; +} + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/fvSchemes new file mode 100644 index 0000000000..a1d24521b2 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/fvSchemes @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ +} + +gradSchemes +{ +} + +divSchemes +{ +} + +laplacianSchemes +{ +} + +interpolationSchemes +{ +} + +snGradSchemes +{ +} + +fluxRequired +{ +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/fvSolution new file mode 100644 index 0000000000..739522fd29 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/fvSolution @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +"(PIMPLE|PISO)" +{ + nOuterCorrectors 1; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/solid/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/solid/fvSchemes new file mode 100644 index 0000000000..4ea7cdaec7 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/solid/fvSchemes @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; +} + +laplacianSchemes +{ + default Gauss linear uncorrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default uncorrected; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/solid/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/solid/fvSolution new file mode 100644 index 0000000000..2459003924 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/solid/fvSolution @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + e + { + solver PCG; + preconditioner DIC; + tolerance 1e-06; + relTol 0.1; + } + + eFinal + { + $e; + relTol 0; + } +} + +PIMPLE +{ + nNonOrthogonalCorrectors 0; +} + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/topoSetDict b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/topoSetDict new file mode 100644 index 0000000000..37fda7c081 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingCylinder2D/system/topoSetDict @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object topoSetDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "$FOAM_CASE/system/blockMeshDict" + +actions +( + { + name cs; + type cellSet; + action new; + source cylinderToCell; + sourceInfo + { + p1 (0 0 -100); + p2 (0 0 100); + centre (0 0 0); + radius $cylinderRadius; + } + } + { + name solid; + type cellZoneSet; + action new; + source setToCellZone; + sourceInfo { set cs; } + } + +); + +// ************************************************************************* //