diff --git a/applications/utilities/preProcessing/foamSetupCHT/Make/files b/applications/utilities/preProcessing/foamSetupCHT/Make/files new file mode 100644 index 000000000..d95cfaa7f --- /dev/null +++ b/applications/utilities/preProcessing/foamSetupCHT/Make/files @@ -0,0 +1,3 @@ +foamSetupCHT.C + +EXE = $(FOAM_APPBIN)/foamSetupCHT diff --git a/applications/utilities/preProcessing/foamSetupCHT/Make/options b/applications/utilities/preProcessing/foamSetupCHT/Make/options new file mode 100644 index 000000000..d27c95d03 --- /dev/null +++ b/applications/utilities/preProcessing/foamSetupCHT/Make/options @@ -0,0 +1,7 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +EXE_LIBS = \ + -lfiniteVolume \ + -lmeshTools diff --git a/applications/utilities/preProcessing/foamSetupCHT/foamSetupCHT.C b/applications/utilities/preProcessing/foamSetupCHT/foamSetupCHT.C new file mode 100644 index 000000000..4b79c3223 --- /dev/null +++ b/applications/utilities/preProcessing/foamSetupCHT/foamSetupCHT.C @@ -0,0 +1,178 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2018 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Application + foamSetupCHT + +Description + This utility sets up a multi-region case using template files for + material properties, field and system files. + + The utility reads constant/materialProperties to create a + regionProperties file and to create region directories containing + required files within the 0, system and constant directories. The + materialProperties file contains mesh region names with an + associated physical region type and a material: + + bottomAir + { + type fluid; + material air; + } + + The case must contain a directory called templates, with e.g. the + following directories and files: + + 0 + + fluid: p, p_rgh, U, T, k, omega, epsilon, nut, alphat + + solid: p, T + + system + + fluid: fvSchemes, fvSolution, decomposeParDict + + solid: fvSchemes, fvSolution, decomposeParDict + + constant + + fluid: g + + solid + + materials + + air: radiationProperties, thermophysicalProperties, turbulenceProperties + + aluminium: radiationProperties, thermophysicalProperties + + ... + +\*---------------------------------------------------------------------------*/ + +#include "argList.H" +#include "Time.H" +#include "IOdictionary.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + #include "createTime.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "Reading material properties\n" << endl; + + IOdictionary materialProperties + ( + IOobject + ( + "materialProperties", + runTime.constant(), + runTime, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + IOdictionary regionProperties + ( + IOobject + ( + "regionProperties", + runTime.constant(), + runTime + ), + dictionary::null + ); + + const fileName currentDir(runTime.path()); + const fileName materialsDir(currentDir/"templates"/"materials"); + const fileName systemDir(currentDir/"templates"/"system"); + const fileName constantDir(currentDir/"templates"/"constant"); + const fileName timeDir(currentDir/"templates"/"0"); + + HashTable regionInfo; + + forAllConstIter(dictionary, materialProperties, regionIter) + { + // Read region subdict name, then its type and material entries + const word& regionName = regionIter().keyword(); + const dictionary& regionDict = regionIter().dict(); + const word regionType(regionDict.lookup("type")); + const word regionMaterial(regionDict.lookup("material")); + + Info<< "\nRegion " << regionName << ":\n" + << "\tCreating 0/" << regionName + << " directory" << endl; + + // Create fluid and solid lists for regionProperties, e.g. + // fluid ( bottomAir ... ) + HashTable::iterator iter = regionInfo.find(regionType); + + if (iter == regionInfo.end()) + { + // Add fluid or solid list if does not exist + regionInfo.insert(regionType, wordList(1, regionName)); + } + else + { + wordList& regionNames = iter(); + if (findIndex(regionNames, regionName) == -1) + { + // Append region name to fluid/solid list + regionNames.append(regionName); + } + } + + // 0/: from fluid/solid template + const fileName sourceDir(timeDir/regionType); + if (isDir(sourceDir)) + { + cpFiles(sourceDir, currentDir/"0"/regionName); + } + else + { + // This needs checking ... + FatalIOErrorIn(args.executable().c_str(), materialProperties) + << "Cannot find region type file " + << sourceDir << exit(FatalIOError); + } + + Info<< "\tCreating constant/" << regionName + << " directory with " << regionMaterial + << " material" << endl; + cpFiles(constantDir/regionType, currentDir/"constant"/regionName); + cpFiles(materialsDir/regionMaterial, currentDir/"constant"/regionName); + + // system/: from fluid or solid templ + Info<< "\tCreating system/" << regionName + << " directory" << endl; + cpFiles(systemDir/regionType, currentDir/"system"/regionName); + } + + regionProperties.add("regions", regionInfo); + + Info<< "\nWriting region properties\n" << endl; + + regionProperties.regIOobject::write(); + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/Allclean b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/Allclean new file mode 100755 index 000000000..d945e388e --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/Allclean @@ -0,0 +1,29 @@ +#!/bin/sh +cd "${0%/*}" || exit 1 # Run from this directory + +# Source tutorial clean functions +. "$WM_PROJECT_DIR/bin/tools/CleanFunctions" + +removeRegionDirs () { + # HACK to get regionDirs from materialProperties + _regionDirs="$(grep -E "^[a-Z]" constant/materialProperties | tail -n +2)" + + for _d in system constant + do + for _r in $_regionDirs + do + _dir="${_d}/${_r}" + [ -d "$_dir" ] && rm -rf "$_dir" + done + done + + find . -name "domain*" -type d | xargs rm -rf +} + +cleanCase +removeRegionDirs +rm -rf 0 > /dev/null 2>&1 +rm -rf constant/regionProperties > /dev/null 2>&1 +# rm -rf constant/extendedFeatureEdgeMesh > /dev/null 2>&1 + +#------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/Allmesh b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/Allmesh new file mode 100755 index 000000000..22bf6744c --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/Allmesh @@ -0,0 +1,12 @@ +#!/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 transformPoints -scale "(0.01 0.01 0.01)" +runApplication splitMeshRegions -cellZones -defaultRegionName fluid -overwrite + +#------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/Allrun b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/Allrun new file mode 100755 index 000000000..e817f6352 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/Allrun @@ -0,0 +1,24 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +./Allmesh + +runApplication foamSetupCHT + +runApplication foamDictionary -disableFunctionEntries \ + -entry internalField -set "uniform 348" 0/solid/T + +runApplication decomposePar -allRegions -dict system/decomposeParDict + +printf "\n%s\n" "Creating files for paraview post-processing" +paraFoam -touchAll +echo + +runParallel $(getApplication) + +runApplication reconstructPar -allRegions + +#------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/initialConditions b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/initialConditions new file mode 100644 index 000000000..a86ec91d1 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/initialConditions @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Tinitial 296; +pInitial 1e5; + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/materialProperties b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/materialProperties new file mode 100644 index 000000000..52bd3073d --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/materialProperties @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object materialProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +fluid +{ + type fluid; + material air; +} + +solid +{ + type solid; + material copper; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/region1/g b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/region1/g new file mode 100644 index 000000000..6f32e3383 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/region1/g @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 -9.81 0); + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/region1/thermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/region1/thermophysicalProperties new file mode 100644 index 000000000..937dce5f0 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/region1/thermophysicalProperties @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState perfectGas; + specie specie; + energy sensibleEnthalpy; +} + +mixture +{ + specie + { + nMoles 1; + molWeight 28.9; // [g/mol] + } + thermodynamics + { + Cp 1005; // [J/(kg K)] + Hf 0; + } + transport + { + mu 1.8e-05; // [kg/(m s)] + Pr 0.7; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/region1/turbulenceProperties b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/region1/turbulenceProperties new file mode 100644 index 000000000..f0add28ce --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/region1/turbulenceProperties @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel kOmegaSST; + + turbulence on; + printCoeffs on; +} + +LES +{ + LESModel SpalartAllmarasDDES; + delta cubeRootVol; + + turbulence on; + printCoeffs on; + + cubeRootVolCoeffs + { + deltaCoeff 1; + } + + smoothCoeffs + { + delta cubeRootVol; + cubeRootVolCoeffs + { + deltaCoeff 1; + } + maxDeltaRatio 1.1; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/transportProperties b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/transportProperties new file mode 100644 index 000000000..2a62bb7f6 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/transportProperties @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu [0 2 -1 0 0 0 0] 1.5e-05; + +BirdCarreauCoeffs +{ + nu0 [0 2 -1 0 0 0 0] 1e-03; + nuInf [0 2 -1 0 0 0 0] 1e-05; + k [0 0 1 0 0 0 0] 1; + n [0 0 0 0 0 0 0] 0.5; +} + +CrossPowerLawCoeffs +{ + nu0 [0 2 -1 0 0 0 0] 1e-03; + nuInf [0 2 -1 0 0 0 0] 1e-05; + m [0 0 1 0 0 0 0] 1; + n [0 0 0 0 0 0 0] 0.5; +} + +powerLawCoeffs +{ + nuMax [0 2 -1 0 0 0 0] 1e-03; + nuMin [0 2 -1 0 0 0 0] 1e-05; + k [0 2 -1 0 0 0 0] 1e-05; + n [0 0 0 0 0 0 0] 1; +} + +HerschelBulkleyCoeffs +{ + nu0 [0 2 -1 0 0 0 0] 1e-03; + tau0 [0 2 -2 0 0 0 0] 1; + k [0 2 -1 0 0 0 0] 1e-05; + n [0 0 0 0 0 0 0] 1; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/triSurface/.keep b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/triSurface/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/turbulenceProperties b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/turbulenceProperties new file mode 100644 index 000000000..f0add28ce --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/constant/turbulenceProperties @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel kOmegaSST; + + turbulence on; + printCoeffs on; +} + +LES +{ + LESModel SpalartAllmarasDDES; + delta cubeRootVol; + + turbulence on; + printCoeffs on; + + cubeRootVolCoeffs + { + deltaCoeff 1; + } + + smoothCoeffs + { + delta cubeRootVol; + cubeRootVolCoeffs + { + deltaCoeff 1; + } + maxDeltaRatio 1.1; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/blockMeshDict b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/blockMeshDict new file mode 100644 index 000000000..8e0fd6a0f --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/blockMeshDict @@ -0,0 +1,150 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +bp 0.4; +bn -0.4; + +dp 4; +dn -4; +dl 10; + +nb 15; +nd 30; +nl 20; + +gd 20; +gl 1; + +geometry +{ + sphere + { + type searchableSphere; + centre (0 0 0); + radius 0.5; + } +} + +convertToMeters 1; + +vertices +( + + project ($bn $bn $bn) (sphere) + project ($bp $bn $bn) (sphere) + project ($bn $bp $bn) (sphere) + project ($bp $bp $bn) (sphere) + + project ($bn $bn $bp) (sphere) + project ($bp $bn $bp) (sphere) + project ($bn $bp $bp) (sphere) + project ($bp $bp $bp) (sphere) + + ($dn $dn $dn) + ($dp $dn $dn) + ($dn $dp $dn) + ($dp $dp $dn) + + ($dn $dn $dp) + ($dp $dn $dp) + ($dn $dp $dp) + ($dp $dp $dp) + + ($dl $dn $dn) + ($dl $dp $dn) + ($dl $dn $dp) + ($dl $dp $dp) +); + +blocks +( + hex (1 0 8 9 5 4 12 13) ($nb $nd $nb) simpleGrading (1 $gd 1) + hex (0 2 10 8 4 6 14 12) ($nb $nd $nb) simpleGrading (1 $gd 1) + hex (2 3 11 10 6 7 15 14) ($nb $nd $nb) simpleGrading (1 $gd 1) + hex (3 1 9 11 7 5 13 15) ($nb $nd $nb) simpleGrading (1 $gd 1) + hex (0 1 9 8 2 3 11 10) ($nb $nd $nb) simpleGrading (1 $gd 1) + hex (5 4 12 13 7 6 14 15) ($nb $nd $nb) simpleGrading (1 $gd 1) + hex (9 16 17 11 13 18 19 15) ($nl $nb $nb) simpleGrading (1 1 1) + + // Solid region + hex (0 1 3 2 4 5 7 6) ($nb $nb $nb) simpleGrading (1 1 1) +); + +edges +( + project 0 2 (sphere) + project 2 3 (sphere) + project 3 1 (sphere) + project 1 0 (sphere) + project 4 6 (sphere) + project 6 7 (sphere) + project 7 5 (sphere) + project 5 4 (sphere) + project 0 4 (sphere) + project 2 6 (sphere) + project 3 7 (sphere) + project 1 5 (sphere) +); + +faces +( + project (0 2 6 4) sphere + project (2 3 7 6) sphere + project (3 1 5 7) sphere + project (1 0 4 5) sphere + project (0 1 3 2) sphere + project (4 5 7 6) sphere +); + +boundary +( + inlet + { + type patch; + faces + ( + (8 10 14 12) + ); + } + + walls + { + type wall; + inGroups (externalWall); + faces + ( + (8 9 11 10) + (12 13 15 14) + (10 11 15 14) + (11 17 19 15) + (9 16 17 11) + (13 18 19 15) + (8 9 13 12) + (9 16 18 13) + ); + } + + outlet + { + type patch; + faces + ( + (16 17 19 18) + ); + } +); + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/controlDict b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/controlDict new file mode 100644 index 000000000..506ebebcc --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/controlDict @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application chtMultiRegionFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 1; + +deltaT 5e-4; + +writeControl runTime; + +writeInterval 0.05; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 8; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +functions +{ +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/decomposeParDict new file mode 100644 index 000000000..929c84b17 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/decomposeParDict @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +method scotch; + +simpleCoeffs +{ + n (2 2 1); + delta 0.001; +} + +hierarchicalCoeffs +{ + n (2 2 1); + delta 0.001; + order xyz; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/fvSchemes new file mode 100644 index 000000000..e7d321e95 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/fvSchemes @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ +} + +gradSchemes +{ +} + +divSchemes +{ +} + +laplacianSchemes +{ +} + +interpolationSchemes +{ +} + +snGradSchemes +{ +} + +fluxRequired +{ +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/fvSolution new file mode 100644 index 000000000..9ef73fbeb --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/fvSolution @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +"(PIMPLE|PISO)" +{ + nOuterCorrectors 1; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/region1/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/region1/decomposeParDict new file mode 100644 index 000000000..929c84b17 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/region1/decomposeParDict @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +method scotch; + +simpleCoeffs +{ + n (2 2 1); + delta 0.001; +} + +hierarchicalCoeffs +{ + n (2 2 1); + delta 0.001; + order xyz; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/region1/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/region1/fvSchemes new file mode 100644 index 000000000..645d08a5a --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/region1/fvSchemes @@ -0,0 +1,81 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; + + limited cellLimited Gauss linear 1; + grad(U) $limited; + grad(k) $limited; + grad(omega) $limited; + grad(epsilon) $limited; +} + +divSchemes +{ + default none; + + div(phi,U) Gauss linearUpwind limited; + + turbulence Gauss limitedLinear 1; + div(phi,k) $turbulence; + div(phi,omega) $turbulence; + div(phi,epsilon) $turbulence; + + div(phi,e) $turbulence; + div(phi,h) $turbulence; + div(phi,K) $turbulence; + div(phi,Ekp) $turbulence; + + div(phid,p) Gauss upwind; + div((phi|interpolate(rho)),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/coolingSphere/system/region1/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/region1/fvSolution new file mode 100644 index 000000000..65124155e --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/region1/fvSolution @@ -0,0 +1,84 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "(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|h|e|k|omega|epsilon)" + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-6; + relTol 0.1; + } + + p_rghFinal + { + $p_rgh; + relTol 0; + } + + "(U|h|e|k|omega|epsilon)Final" + { + $U; + relTol 0; + } +} + +"(PIMPLE|PISO)" +{ + nOuterCorrectors 1; + nCorrectors 2; + nNonOrthogonalCorrectors 1; + pRefCell 0; + pRefValue 0; +} + +SIMPLE +{ + nNonOrthogonalCorrectors 0; + rhoMax 2; + rhoMin 1; +} + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/topoSetDict b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/topoSetDict new file mode 100644 index 000000000..8a20a7a2f --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/system/topoSetDict @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object topoSetDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "$FOAM_CASE/system/blockMeshDict" + +actions +( + { + name cs; + type cellSet; + action new; + source sphereToCell; + sourceInfo + { + centre (0 0 0); + radius $:geometry.sphere.radius; + } + } + { + name solid; + type cellZoneSet; + action new; + source setToCellZone; + sourceInfo { set cs; } + } +); + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/T b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/T new file mode 100644 index 000000000..a78e343b0 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/T @@ -0,0 +1,58 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "$FOAM_CASE/constant/initialConditions"; + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform $Tinitial; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform $Tinitial; + } + + outlet + { + type inletOutlet; + inletValue uniform $Tinitial; + value uniform $Tinitial; + } + + wall + { + type compressible::turbulentTemperatureCoupledBaffleMixed; + neighbourFieldName T; + kappaMethod fluidThermo; + kappa kappa; + Tnbr T; + value uniform $Tinitial; + } + + externalWall + { + type fixedValue; + value uniform $Tinitial; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/U b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/U new file mode 100644 index 000000000..6d0fdf8a6 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/U @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Uinlet (10 0 0); + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + inlet + { + type fixedValue; + value uniform $Uinlet; + } + + outlet + { + type pressureInletOutletVelocity; + value uniform $Uinlet; + } + + wall + { + type noSlip; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/alphat b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/alphat new file mode 100644 index 000000000..fdf9f6628 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/alphat @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object alphat; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type calculated; + value uniform 0; + } + + outlet + { + type calculated; + value uniform 0; + } + + wall + { + type compressible::alphatWallFunction; + value uniform 0; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/epsilon b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/epsilon new file mode 100644 index 000000000..0253ee2ac --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/epsilon @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +epsilonInlet 0.001; +mixingLengthInlet 0.007; + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform $epsilonInlet; + +boundaryField +{ + inlet + { + type turbulentMixingLengthDissipationRateInlet; + mixingLength $mixingLengthInlet; + value uniform $epsilonInlet; + } + + outlet + { + type inletOutlet; + value uniform $epsilonInlet; + inletValue uniform $epsilonInlet; + } + + wall + { + type compressible::epsilonWallFunction; + value uniform $epsilonInlet; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/k b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/k new file mode 100644 index 000000000..83cab05a5 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/k @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +kInlet 0.02; +intensityInlet 0.01; + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform $kInlet; + +boundaryField +{ + inlet + { + type turbulentIntensityKineticEnergyInlet; + intensity $intensityInlet; + value uniform $kInlet; + } + + outlet + { + type inletOutlet; + inletValue uniform $kInlet; + value uniform $kInlet; + } + + wall + { + type kqRWallFunction; + value uniform $kInlet; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/nut b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/nut new file mode 100644 index 000000000..54a56f319 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/nut @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type calculated; + value uniform 0; + } + + outlet + { + type calculated; + value uniform 0; + } + + wall + { + type nutkWallFunction; + value uniform 0; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/omega b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/omega new file mode 100644 index 000000000..1f4e84388 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/omega @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object omega; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +omegaInlet 10; +mixingLengthInlet 0.0035; + +dimensions [0 0 -1 0 0 0 0]; + +internalField uniform $omegaInlet; + +boundaryField +{ + inlet + { + type turbulentMixingLengthFrequencyInlet; + mixingLength $mixingLengthInlet; + value uniform $omegaInlet; + } + + outlet + { + type inletOutlet; + inletValue uniform $omegaInlet; + value uniform $omegaInlet; + } + + wall + { + type omegaWallFunction; + value uniform $omegaInlet; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/p b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/p new file mode 100644 index 000000000..09072a3cf --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/p @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "$FOAM_CASE/constant/initialConditions"; + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform $pInitial; + +boundaryField +{ + outlet + { + type calculated; + value uniform $pInitial; + } + + inlet + { + type calculated; + value uniform $pInitial; + } + + wall + { + $inlet; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/p_rgh b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/p_rgh new file mode 100644 index 000000000..1ab46279f --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/fluid/p_rgh @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "$FOAM_CASE/constant/initialConditions"; + +dimensions [ 1 -1 -2 0 0 0 0 ]; + +internalField uniform $pInitial; + +boundaryField +{ + outlet + { + type fixedValue; + value uniform $pInitial; + } + + inlet + { + type fixedFluxPressure; + value uniform $pInitial; + } + + wall + { + $inlet; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/solid/T b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/solid/T new file mode 100644 index 000000000..bbc1ce49b --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/solid/T @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "$FOAM_CASE/constant/initialConditions"; + +dimensions [ 0 0 0 1 0 0 0 ]; + +internalField uniform $Tinitial; + +boundaryField +{ + wall + { + type compressible::turbulentTemperatureCoupledBaffleMixed; + value $internalField; + kappaMethod solidThermo; + kappa kappa; + Tnbr T; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/solid/p b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/solid/p new file mode 100644 index 000000000..5e05bd4df --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/0/solid/p @@ -0,0 +1,34 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "$FOAM_CASE/constant/initialConditions"; + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform $pInitial; + +boundaryField +{ + ".*" + { + type calculated; + value uniform $pInitial; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/constant/fluid/g b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/constant/fluid/g new file mode 100644 index 000000000..6f32e3383 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/constant/fluid/g @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 -9.81 0); + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/air/thermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/air/thermophysicalProperties new file mode 100644 index 000000000..937dce5f0 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/air/thermophysicalProperties @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState perfectGas; + specie specie; + energy sensibleEnthalpy; +} + +mixture +{ + specie + { + nMoles 1; + molWeight 28.9; // [g/mol] + } + thermodynamics + { + Cp 1005; // [J/(kg K)] + Hf 0; + } + transport + { + mu 1.8e-05; // [kg/(m s)] + Pr 0.7; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/air/turbulenceProperties b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/air/turbulenceProperties new file mode 100644 index 000000000..f0add28ce --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/air/turbulenceProperties @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel kOmegaSST; + + turbulence on; + printCoeffs on; +} + +LES +{ + LESModel SpalartAllmarasDDES; + delta cubeRootVol; + + turbulence on; + printCoeffs on; + + cubeRootVolCoeffs + { + deltaCoeff 1; + } + + smoothCoeffs + { + delta cubeRootVol; + cubeRootVolCoeffs + { + deltaCoeff 1; + } + maxDeltaRatio 1.1; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/aluminium/thermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/aluminium/thermophysicalProperties new file mode 100644 index 000000000..2e0722b05 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/aluminium/thermophysicalProperties @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heSolidThermo; + mixture pureMixture; + transport constIso; + thermo hConst; + equationOfState rhoConst; + specie specie; + energy sensibleEnthalpy; +} + +mixture +{ + specie + { + nMoles 1; + molWeight 27; // [g/mol] + } + + transport + { + kappa 240; // [W/(m K)] + } + + thermodynamics + { + Hf 0; + Cp 896; // [J/(kg K)] + } + + equationOfState + { + rho 2712; // [kg/m3] + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/copper/thermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/copper/thermophysicalProperties new file mode 100644 index 000000000..e84e90a23 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/copper/thermophysicalProperties @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heSolidThermo; + mixture pureMixture; + transport constIso; + thermo hConst; + equationOfState rhoConst; + specie specie; + energy sensibleEnthalpy; +} + +mixture +{ + specie + { + nMoles 1; + molWeight 63.5; // [g/mol] + } + + transport + { + kappa 380; // [W/(m K)] + } + + thermodynamics + { + Hf 0; + Cp 385; // [J/(kg K)] + } + + equationOfState + { + rho 8940; // [kg/m3] + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/water/thermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/water/thermophysicalProperties new file mode 100644 index 000000000..e3594523e --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/water/thermophysicalProperties @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState perfectGas; + specie specie; + energy sensibleEnthalpy; +} + +mixture +{ + specie + { + nMoles 1; + molWeight 18.0; // [g/mol] + } + thermodynamics + { + Cp 4181; // [J/(kg K)] at T = 293 K + Hf 0; + } + transport + { + mu 1.0e-03; // [kg/(m s)] + Pr 0.7; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/water/turbulenceProperties b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/water/turbulenceProperties new file mode 100644 index 000000000..f0add28ce --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/materials/water/turbulenceProperties @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel kOmegaSST; + + turbulence on; + printCoeffs on; +} + +LES +{ + LESModel SpalartAllmarasDDES; + delta cubeRootVol; + + turbulence on; + printCoeffs on; + + cubeRootVolCoeffs + { + deltaCoeff 1; + } + + smoothCoeffs + { + delta cubeRootVol; + cubeRootVolCoeffs + { + deltaCoeff 1; + } + maxDeltaRatio 1.1; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/system/fluid/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/system/fluid/fvSchemes new file mode 100644 index 000000000..645d08a5a --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/system/fluid/fvSchemes @@ -0,0 +1,81 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; + + limited cellLimited Gauss linear 1; + grad(U) $limited; + grad(k) $limited; + grad(omega) $limited; + grad(epsilon) $limited; +} + +divSchemes +{ + default none; + + div(phi,U) Gauss linearUpwind limited; + + turbulence Gauss limitedLinear 1; + div(phi,k) $turbulence; + div(phi,omega) $turbulence; + div(phi,epsilon) $turbulence; + + div(phi,e) $turbulence; + div(phi,h) $turbulence; + div(phi,K) $turbulence; + div(phi,Ekp) $turbulence; + + div(phid,p) Gauss upwind; + div((phi|interpolate(rho)),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/coolingSphere/templates/system/fluid/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/system/fluid/fvSolution new file mode 100644 index 000000000..65124155e --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/system/fluid/fvSolution @@ -0,0 +1,84 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "(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|h|e|k|omega|epsilon)" + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-6; + relTol 0.1; + } + + p_rghFinal + { + $p_rgh; + relTol 0; + } + + "(U|h|e|k|omega|epsilon)Final" + { + $U; + relTol 0; + } +} + +"(PIMPLE|PISO)" +{ + nOuterCorrectors 1; + nCorrectors 2; + nNonOrthogonalCorrectors 1; + pRefCell 0; + pRefValue 0; +} + +SIMPLE +{ + nNonOrthogonalCorrectors 0; + rhoMax 2; + rhoMin 1; +} + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/system/solid/fvOptions b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/system/solid/fvOptions new file mode 100644 index 000000000..3a238825b --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/system/solid/fvOptions @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object porousZone; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +fixedTemperature +{ + type fixedTemperatureConstraint; + active no; + selectionMode all; + + mode uniform; + + temperature constant 300; // Set temperature (K) +} + +fixedPower +{ + type scalarSemiImplicitSource; + active no; + selectionMode all; + + volumeMode absolute; + + power 100; // Set power (W) + + injectionRateSuSp + { + e ($power 0); + h ($power 0); + } +} + +//************************************************************************** // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/system/solid/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/system/solid/fvSchemes new file mode 100644 index 000000000..074dac3f7 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/system/solid/fvSchemes @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class 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/coolingSphere/templates/system/solid/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/system/solid/fvSolution new file mode 100644 index 000000000..ecbfbcb31 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/coolingSphere/templates/system/solid/fvSolution @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "(h|e)" + { + solver PCG; + preconditioner DIC; + tolerance 1e-06; + relTol 0.1; + } + + "(h|e)Final" + { + $h; + relTol 0; + } +} + +"(SIMPLE|PIMPLE|PISO)" +{ + nNonOrthogonalCorrectors 0; +} + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + +// ************************************************************************* //