diff --git a/src/regionModels/thermalBaffleModels/derivedFvPatchFields/thermalBaffle/thermalBaffleFvPatchScalarField.C b/src/regionModels/thermalBaffleModels/derivedFvPatchFields/thermalBaffle/thermalBaffleFvPatchScalarField.C index 7739e40395..9b2221a16f 100644 --- a/src/regionModels/thermalBaffleModels/derivedFvPatchFields/thermalBaffle/thermalBaffleFvPatchScalarField.C +++ b/src/regionModels/thermalBaffleModels/derivedFvPatchFields/thermalBaffle/thermalBaffleFvPatchScalarField.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -47,6 +48,7 @@ thermalBaffleFvPatchScalarField::thermalBaffleFvPatchScalarField : turbulentTemperatureRadCoupledMixedFvPatchScalarField(p, iF), owner_(false), + internal_(true), baffle_(), dict_(dictionary::null), extrudeMeshPtr_() @@ -69,6 +71,7 @@ thermalBaffleFvPatchScalarField::thermalBaffleFvPatchScalarField mapper ), owner_(ptf.owner_), + internal_(ptf.internal_), baffle_(), dict_(ptf.dict_), extrudeMeshPtr_() @@ -84,6 +87,7 @@ thermalBaffleFvPatchScalarField::thermalBaffleFvPatchScalarField : turbulentTemperatureRadCoupledMixedFvPatchScalarField(p, iF, dict), owner_(false), + internal_(true), baffle_(), dict_(dict), extrudeMeshPtr_() @@ -93,27 +97,27 @@ thermalBaffleFvPatchScalarField::thermalBaffleFvPatchScalarField typedef regionModels::thermalBaffleModels::thermalBaffleModel baffle; - if (thisMesh.name() == polyMesh::defaultRegion) + word regionName("none"); + dict_.readIfPresent("region", regionName); + + dict_.readIfPresent("internal", internal_); + + const word baffleName("3DBaffle" + regionName); + + if + ( + !thisMesh.time().foundObject(regionName) + && regionName != "none" + ) { - const word regionName = dict_.lookupOrDefault("region", "none"); - - const word baffleName("3DBaffle" + regionName); - - if - ( - !thisMesh.time().foundObject(regionName) - && regionName != "none" - ) + if (extrudeMeshPtr_.empty()) { - if (extrudeMeshPtr_.empty()) - { - createPatchMesh(); - } - - baffle_.reset(baffle::New(thisMesh, dict).ptr()); - owner_ = true; - baffle_->rename(baffleName); + createPatchMesh(); } + + baffle_.reset(baffle::New(thisMesh, dict).ptr()); + owner_ = true; + baffle_->rename(baffleName); } } @@ -126,6 +130,7 @@ thermalBaffleFvPatchScalarField::thermalBaffleFvPatchScalarField : turbulentTemperatureRadCoupledMixedFvPatchScalarField(ptf, iF), owner_(ptf.owner_), + internal_(ptf.internal_), baffle_(), dict_(ptf.dict_), extrudeMeshPtr_() @@ -170,7 +175,15 @@ void thermalBaffleFvPatchScalarField::createPatchMesh() patchNames[topPatchID] = word("top"); patchTypes[bottomPatchID] = mappedWallPolyPatch::typeName; - patchTypes[topPatchID] = mappedWallPolyPatch::typeName; + + if (internal_) + { + patchTypes[topPatchID] = mappedWallPolyPatch::typeName; + } + else + { + patchTypes[topPatchID] = polyPatch::typeName; + } if (dict_.get("columnCells")) { @@ -189,17 +202,24 @@ void thermalBaffleFvPatchScalarField::createPatchMesh() wordList inGroups(1); inGroups[0] = coupleGroup; + // The bottomPatchID is coupled with this patch dicts[bottomPatchID].add("coupleGroup", coupleGroup); dicts[bottomPatchID].add("inGroups", inGroups); dicts[bottomPatchID].add("sampleMode", mpp.sampleModeNames_[mpp.mode()]); + dicts[bottomPatchID].add("samplePatch", patch().name()); + dicts[bottomPatchID].add("sampleRegion", thisMesh.name()); - const word coupleGroupSlave = - coupleGroup.substr(0, coupleGroup.find('_')) + "_slave"; + // Internal baffle needs a coupled on the topPatchID + if (internal_) + { + const word coupleGroupSlave = + coupleGroup.substr(0, coupleGroup.find('_')) + "_slave"; - inGroups[0] = coupleGroupSlave; - dicts[topPatchID].add("coupleGroup", coupleGroupSlave); - dicts[topPatchID].add("inGroups", inGroups); - dicts[topPatchID].add("sampleMode", mpp.sampleModeNames_[mpp.mode()]); + inGroups[0] = coupleGroupSlave; + dicts[topPatchID].add("coupleGroup", coupleGroupSlave); + dicts[topPatchID].add("inGroups", inGroups); + dicts[topPatchID].add("sampleMode", mpp.sampleModeNames_[mpp.mode()]); + } forAll(regionPatches, patchi) @@ -247,9 +267,7 @@ void thermalBaffleFvPatchScalarField::updateCoeffs() return; } - const fvMesh& thisMesh = patch().boundaryMesh().mesh(); - - if (owner_ && thisMesh.name() == polyMesh::defaultRegion) + if (owner_) { baffle_->evolve(); } @@ -262,9 +280,7 @@ void thermalBaffleFvPatchScalarField::write(Ostream& os) const { turbulentTemperatureRadCoupledMixedFvPatchScalarField::write(os); - const fvMesh& thisMesh = patch().boundaryMesh().mesh(); - - if (owner_ && (thisMesh.name() == polyMesh::defaultRegion)) + if (owner_) { os.writeEntry("extrudeModel", dict_.get("extrudeModel")); @@ -281,6 +297,8 @@ void thermalBaffleFvPatchScalarField::write(Ostream& os) const os.writeEntry("region", dict_.get("region")); + os.writeEntryIfDifferent("internal", true, internal_); + os.writeEntry("active", dict_.get("active")); os.writeKeyword("thermoType"); diff --git a/src/regionModels/thermalBaffleModels/derivedFvPatchFields/thermalBaffle/thermalBaffleFvPatchScalarField.H b/src/regionModels/thermalBaffleModels/derivedFvPatchFields/thermalBaffle/thermalBaffleFvPatchScalarField.H index 088088e2d6..3637a77d88 100644 --- a/src/regionModels/thermalBaffleModels/derivedFvPatchFields/thermalBaffle/thermalBaffleFvPatchScalarField.H +++ b/src/regionModels/thermalBaffleModels/derivedFvPatchFields/thermalBaffle/thermalBaffleFvPatchScalarField.H @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -40,11 +41,53 @@ Description The primary region creates the baffle region and evolves its energy equation either: - 1-D, normal to each patch face - - 2-D, normal and tangential components + - 3-D, normal and tangential components The thermodynamic properties of the baffle material are specified via dictionary entries on the master patch. + The underlying polyPatch on the primary region needs to be defined + as a complete mappedWall. i.e: + + \verbatim + type mappedWall; + sampleMode nearestPatchFace; + samplePatch ; + sampleRegion ; + + coupleGroup ; + + \endverbatim + + The /keyword{internal} is true when the thermal baffle is used on internal + faces and the baffle is coupled on both sides (bottom and top). + + If this baffle is used on a patch set internal = false. By default is + true. + + \table + Property | Description | Required | Default value + Tnbr | name of the field | no | T + qrNbr | name of the radiative flux in the nbr region | no | none + qr | name of the radiative flux in this region | no | none + thicknessLayers | inherited from temperatureCoupledBase | inherited + kappaLayers | inherited from temperatureCoupledBase | inherited + kappaMethod | inherited from temperatureCoupledBase | inherited + kappa | inherited from temperatureCoupledBase | inherited + thermalInertia | Add thermal inertia to wall node | no | false + region | Name of the solid region | yes + active | Active | yes + internal | Is the baffle an internal regiion | no | true + thermoType | Solid thermo type | yes + mixture | Mixture solid | yes + radiation | Radiation model in the solid | yes + extrudeModel | Extrude model | yes + nLayers | Number of cell across the ragion | yes + expansionRatio | Expansion ratio for the solid region | yes + columnCells | true for 1D or false for 3D region | yes + + \endtable + Usage Example of the boundary condition specification: \verbatim @@ -61,8 +104,9 @@ Usage value uniform 300; // Baffle region name - regionName baffleRegion; + region baffleRegion; active yes; + internal yes; // Solid thermo in solid region thermoType @@ -118,6 +162,9 @@ Usage } \endverbatim + If the thermal baffle is used on internal faces of the primary region, + then the slave in this region is defined as : + Slave patch on primary region: \verbatim @@ -195,6 +242,9 @@ class thermalBaffleFvPatchScalarField //- Is the baffle owner bool owner_; + //- Is the baffle internal + bool internal_; + //- Thermal baffle autoPtr baffle_; diff --git a/src/regionModels/thermalBaffleModels/thermalBaffle/thermalBaffle.C b/src/regionModels/thermalBaffleModels/thermalBaffle/thermalBaffle.C index 44422f683b..9533a415c6 100644 --- a/src/regionModels/thermalBaffleModels/thermalBaffle/thermalBaffle.C +++ b/src/regionModels/thermalBaffleModels/thermalBaffle/thermalBaffle.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -190,7 +191,7 @@ thermalBaffle::thermalBaffle regionMesh().time().timeName(), regionMesh(), IOobject::READ_IF_PRESENT, - IOobject::NO_WRITE + IOobject::AUTO_WRITE ), regionMesh(), dimensionedScalar(dimEnergy/dimVolume/dimTime, Zero) diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/T b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/T new file mode 100644 index 0000000000..dae501dcf3 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/T @@ -0,0 +1,119 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + floor + { + type zeroGradient; + } + ceiling + { + + type compressible::thermalBaffle; + + // Underlying coupled boundary condition + Tnbr T; + kappaMethod fluidThermo; // or solidThermo + + qrNbr none;//or none.Name of qr field on neighbourregion + qr none;// or none.Name of qr field on localregion + value uniform 300; + + // Baffle region name + region baffle3DRegion; + active yes; + + // The baffle is extruded from this patch to the patch 'bottom' + // of the solid region. + internal no; + + // Solid thermo in solid region + thermoType + { + type heSolidThermo; + mixture pureMixture; + transport constIso; + thermo hConst; + equationOfState rhoConst; + specie specie; + energy sensibleEnthalpy; + } + + mixture + { + specie + { + molWeight 20; + } + transport + { + kappa 0.01; + } + thermodynamics + { + Hf 0; + Cp 15; + } + equationOfState + { + rho 80; + } + } + + radiation + { + radiationModel opaqueSolid; + absorptionEmissionModel none; + scatterModel none; + } + + // Extrude model for new region + extrudeModel linearNormal; + nLayers 50; + expansionRatio 1; + columnCells false; //3D + linearNormalCoeffs + { + thickness 0.1; + } + + + } + inlet + { + type fixedValue; + value uniform 300; + } + outlet + { + type inletOutlet; + inletValue uniform 300; + value uniform 300; + } + fixedWalls + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/U b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/U new file mode 100644 index 0000000000..4620aaed38 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/U @@ -0,0 +1,56 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0"; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + floor + { + type fixedValue; + value uniform (0 0 0); + } + ceiling + { + type fixedValue; + value uniform (0 0 0); + } + inlet + { + type fixedValue; + value uniform (0 0 0); + inletValue uniform (0 0 0); + } + outlet + { + type fixedValue; + inletValue uniform (0 0 0); + value uniform (0 0 0); + } + fixedWalls + { + type empty; + } + +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/alphat b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/alphat new file mode 100644 index 0000000000..6dc7b4d0ff --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/alphat @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + floor + { + type compressible::alphatWallFunction; + Prt 0.85; + value uniform 0; + } + ceiling + { + type compressible::alphatWallFunction; + Prt 0.85; + value uniform 0; + } + inlet + { + type compressible::alphatWallFunction; + Prt 0.85; + value uniform 0; + } + outlet + { + type compressible::alphatWallFunction; + Prt 0.85; + value uniform 0; + } + fixedWalls + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/baffle3DRegion/T b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/baffle3DRegion/T new file mode 100644 index 0000000000..45e8c8b4ce --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/baffle3DRegion/T @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + // This patch is the coupled with the ceiling in the fluid region + bottom + { + type compressible::thermalBaffle; + kappaMethod solidThermo; + value uniform 300; + } + side + { + type zeroGradient; + } + + // This the external patch of the solid + top + { + type fixedValue; + value uniform 340; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/baffle3DRegion/p b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/baffle3DRegion/p new file mode 100644 index 0000000000..5a239f0059 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/baffle3DRegion/p @@ -0,0 +1,31 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e6; + +boundaryField +{ + ".*" + { + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/epsilon b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/epsilon new file mode 100644 index 0000000000..30be6dd130 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/epsilon @@ -0,0 +1,65 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 0.01; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + floor + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.01; + } + ceiling + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.01; + } + inlet + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.01; + } + outlet + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.01; + } + fixedWalls + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/k b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/k new file mode 100644 index 0000000000..a1989215fc --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/k @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.1; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + floor + { + type kqRWallFunction; + value uniform 0.1; + } + ceiling + { + type kqRWallFunction; + value uniform 0.1; + } + inlet + { + type kqRWallFunction; + value uniform 0.1; + } + outlet + { + type kqRWallFunction; + value uniform 0.1; + } + fixedWalls + { + type empty; + } + +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/nut b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/nut new file mode 100644 index 0000000000..8807ecb41e --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/nut @@ -0,0 +1,66 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + floor + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + ceiling + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + inlet + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + outlet + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + fixedWalls + { + type empty; + } + +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/p b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/p new file mode 100644 index 0000000000..1ee0bcfd98 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/p @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 101325; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + floor + { + type calculated; + value uniform 101325; + } + ceiling + { + type calculated; + value uniform 101325; + } + inlet + { + type calculated; + value uniform 101325; + } + outlet + { + type calculated; + value uniform 101325; + } + fixedWalls + { + type empty; + } + +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/p_rgh b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/p_rgh new file mode 100644 index 0000000000..9b25101cf9 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/0.orig/p_rgh @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 101325; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + floor + { + type fixedFluxPressure; + } + ceiling + { + type fixedFluxPressure; + } + inlet + { + type fixedFluxPressure; + } + outlet + { + type fixedFluxPressure; + } + fixedWalls + { + type empty; + } + +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/Allclean b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/Allclean new file mode 100755 index 0000000000..ee9650d03e --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/Allclean @@ -0,0 +1,10 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions +#------------------------------------------------------------------------------ + +cleanCase0 + +rm -rf constant/baffle3DRegion + +#------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/Allrun b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/Allrun new file mode 100755 index 0000000000..31d94cec26 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/Allrun @@ -0,0 +1,15 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +runApplication blockMesh + +restore0Dir + +# change to mapped BC the polyPatch +runApplication changeDictionary + +runApplication $(getApplication) + +#------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/constant/g b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/constant/g new file mode 100644 index 0000000000..957ac3d144 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/constant/g @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 -9.81 0); + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/constant/thermophysicalProperties new file mode 100644 index 0000000000..a2a275dbeb --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/constant/thermophysicalProperties @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState perfectGas; + specie specie; + energy sensibleEnthalpy; +} + +mixture +{ + specie + { + molWeight 28.96; + } + thermodynamics + { + Cp 1004.4; + Hf 0; + } + transport + { + mu 1.831e-05; + Pr 0.705; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/constant/turbulenceProperties b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/constant/turbulenceProperties new file mode 100644 index 0000000000..737ef960ae --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/constant/turbulenceProperties @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel kEpsilon; + + turbulence on; + + printCoeffs on; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/system/baffle3DRegion/fvSchemes b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/system/baffle3DRegion/fvSchemes new file mode 100644 index 0000000000..9238bf1ebb --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/system/baffle3DRegion/fvSchemes @@ -0,0 +1,40 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system/baffleRegion"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +divSchemes +{ + default none; +} + +gradSchemes +{ + default Gauss linear; +} + +laplacianSchemes +{ + default none; + laplacian(alpha,h) Gauss linear uncorrected; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/system/baffle3DRegion/fvSolution b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/system/baffle3DRegion/fvSolution new file mode 100644 index 0000000000..e4e5499bcd --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/system/baffle3DRegion/fvSolution @@ -0,0 +1,37 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system/baffleRegion"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + h + { + solver PCG; + smoother GaussSeidel; + preconditioner DIC; + tolerance 1e-06; + relTol 0; + } +} + +nNonOrthCorr 0; + +relaxationFactors +{ + h 1; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/system/blockMeshDict b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/system/blockMeshDict new file mode 100644 index 0000000000..67d503b253 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/system/blockMeshDict @@ -0,0 +1,93 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +scale 0.1; + +vertices +( + (0 0 0) + (10 0 0) + (10 5 0) + (0 5 0) + (0 0 1) + (10 0 1) + (10 5 1) + (0 5 1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (50 40 1) simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + floor + { + type wall; + faces + ( + (1 5 4 0) + ); + } + + ceiling + { + type wall; + faces + ( + (2 6 7 3) + ); + } + + inlet + { + type wall; + faces + ( + (0 4 7 3) + ); + } + + outlet + { + type wall; + faces + ( + (1 5 6 2) + ); + } + + fixedWalls + { + type empty; + faces + ( + (0 3 2 1) + (4 5 6 7) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/system/changeDictionaryDict b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/system/changeDictionaryDict new file mode 100644 index 0000000000..fc69f53a16 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/system/changeDictionaryDict @@ -0,0 +1,36 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object changeDictionaryDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + + + boundary + { + ceiling + { + type mappedWall; + sampleMode nearestPatchFace; + samplePatch bottom; + sampleRegion baffle3DRegion; + coupleGroup ceiling_baffle; + + offsetMode uniform; + offset (0 0 0); + } + } + + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/system/controlDict b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/system/controlDict new file mode 100644 index 0000000000..ee57349006 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/system/controlDict @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application buoyantSimpleFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 9000; + +deltaT 1; + +writeControl timeStep; + +writeInterval 500; + +purgeWrite 3; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +libs (thermalBaffleModels); + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/system/fvSchemes new file mode 100644 index 0000000000..c8a2828c16 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/system/fvSchemes @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) bounded Gauss limitedLinear 0.2; + div(phi,K) bounded Gauss limitedLinear 0.2; + div(phi,h) bounded Gauss limitedLinear 0.2; + div(phi,k) bounded Gauss limitedLinear 0.2; + div(phi,epsilon) bounded Gauss limitedLinear 0.2; + div(phi,omega) bounded Gauss limitedLinear 0.2; + div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear uncorrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default uncorrected; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/system/fvSolution b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/system/fvSolution new file mode 100644 index 0000000000..ad6f1db273 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/roomWithThickCeiling/system/fvSolution @@ -0,0 +1,66 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1906 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p_rgh + { + solver GAMG; + tolerance 1e-7; + relTol 0.01; + + smoother DICGaussSeidel; + + } + + "(U|h|k|epsilon|omega)" + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-7; + relTol 0.01; + } +} + +SIMPLE +{ + momentumPredictor no; + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 0; + + residualControl + { + p_rgh 1e-3; + U 1e-4; + h 1e-4; + + // possibly check turbulence fields + "(k|epsilon|omega)" 5e-3; + } +} + +relaxationFactors +{ + p_rgh 0.7; + U 0.3; + h 0.8; + "(k|epsilon|omega)" 0.3; +} + + +// ************************************************************************* //