ENH: Added contact resistance to multi-world. See #1535.

- added contact resistance to turbulentTemperatureCoupledBaffleMixed
- added basic multi-world to turbulentTemperatureRadCoupledMixed
- added unit-testcase to $FOAM_APP/test/multiWorld
This commit is contained in:
mattijs 2021-10-18 19:20:38 +01:00
parent 3e026783ab
commit 2a2edf5fee
51 changed files with 1669 additions and 106 deletions

View File

@ -0,0 +1,15 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
#- Run in multi-region mode using chtMultiRegionFoam
( cd solid1_solid2 && ./Allrun )
#- Run in multi-world mode
# Could run chtMultiRegionFoam with single solid instead of solidFoam
(cd solid1 && runApplication blockMesh)
(cd solid2 && runApplication blockMesh)
mpirun -app mpirun.schema
#------------------------------------------------------------------------------

View File

@ -0,0 +1,2 @@
-np 1 xterm -font fixed -title fluid -geometry 200x15+0+0 -e ./run_solid1.sh
-np 1 xterm -font fixed -title solid -geometry 200x15+0+200 -e ./run_solid2.sh

View File

@ -0,0 +1,8 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
#------------------------------------------------------------------------------
solidFoam -case solid1 -world solid1 2>&1 | tee log.solidFoam_solid1
read dummy
#------------------------------------------------------------------------------

View File

@ -0,0 +1,8 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
#------------------------------------------------------------------------------
solidFoam -case solid2 -world solid2 2>&1 | tee log.solidFoam_solid2
read dummy
#------------------------------------------------------------------------------

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 400;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
bottom
{
type compressible::turbulentTemperatureRadCoupledMixed;
value $internalField;
Tnbr T;
kappaMethod solidThermo;
thicknessLayers (1e-2);
kappaLayers (400);
}
top
{
type zeroGradient;
}
left
{
type zeroGradient;
}
right
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: 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 100000;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
top
{
type calculated;
value $internalField;
}
left
{
type calculated;
value $internalField;
}
right
{
type calculated;
value $internalField;
}
bottom
{
type calculated;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,20 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ 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);
// ************************************************************************* //

View File

@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object radiationProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -0,0 +1,52 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ 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
{
molWeight 50;
}
transport
{
kappa 80;
}
thermodynamics
{
Hf 0;
Cp 450;
}
equationOfState
{
rho 8000;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,96 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 1;
vertices
(
(-0.1 0.00 -0.05)
( 0.1 0.00 -0.05)
( 0.1 0.04 -0.05)
(-0.1 0.04 -0.05)
(-0.1 0.00 0.05)
( 0.1 0.00 0.05)
( 0.1 0.04 0.05)
(-0.1 0.04 0.05)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (20 10 1) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
bottom
{
type mappedWall;
inGroups 1 ( wall );
sampleMode nearestPatchFace;
sampleWorld solid2;
sampleRegion region0;
samplePatch top;
faces
(
(1 5 4 0)
);
}
top
{
type wall;
faces
(
(3 7 6 2)
);
}
left
{
type wall;
faces
(
(0 4 7 3)
);
}
right
{
type wall;
faces
(
(2 6 5 1)
);
}
frontAndBack
{
type empty;
faces
(
(0 3 2 1)
(4 5 6 7)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1,61 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application solidFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 500;
deltaT 1;
//writeControl adjustable;
//writeInterval 0.1;
writeControl timeStep;
writeInterval 10;
purgeWrite 0;
writeFormat ascii;
writePrecision 8;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
//maxCo 0.6;
// Maximum diffusion number
//maxDi 10.0;
//adjustTimeStep yes;
//functions
//{
// #include "vtkWrite"
//}
// ************************************************************************* //

View File

@ -0,0 +1,54 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
method scotch;
// method hierarchical;
// method simple;
regions
{
heater
{
numberOfSubdomains 1;
method simple; // none;
coeffs
{
n (1 1 1);
}
}
}
coeffs
{
n (2 2 1);
}
/*
constraints
{
//- Keep owner and neighbour on same processor for faces in zones:
faces
{
type preserveFaceZones;
zones (heater solid1 solid3);
}
}
*/
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
//default Euler;
default steadyState;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
}
laplacianSchemes
{
default none;
laplacian(alpha,h) Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
// ************************************************************************* //

View File

@ -0,0 +1,53 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
h
{
solver PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0.1;
}
hFinal
{
$h;
tolerance 1e-06;
relTol 0;
}
}
PIMPLE
{
nNonOrthogonalCorrectors 0;
}
SIMPLE
{
nNonOrthogonalCorrectors 0;
}
relaxationFactors
{
equations
{
h 0.7;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,61 @@
// -*- C++ -*-
// Use the vtkWrite function object
vtkWrite
{
type vtkWrite;
libs (utilityFunctionObjects);
log true;
writeControl writeTime;
writeInterval 1;
regions (".*");
internal true;
boundary true;
single false;
interpolate true;
// Fields to output (words or regex)
fields (".*");
//- Output format (ascii | binary) - Default=binary
// format binary;
//- Use legacy output format - Default=false
// legacy false;
//- Output directory name - Default="postProcessing/<name>"
// directory "VTK";
//- Write cell ids as field - Default=true
writeIds false;
}
// Solid walls only
walls
{
type vtkWrite;
libs (utilityFunctionObjects);
log true;
writeControl writeTime;
writeInterval 1;
internal false;
// single true;
regions ( heater "(?i).*solid" );
patches ( "(?i).*solid_to.*" "heater.*(Air|Water)" );
fields (T);
}
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 400;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
bottom
{
type compressible::turbulentTemperatureRadCoupledMixed;
value $internalField;
Tnbr T;
kappaMethod solidThermo;
thicknessLayers (1e-2);
kappaLayers (400);
}
top
{
type zeroGradient;
}
left
{
type zeroGradient;
}
right
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: 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 100000;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
top
{
type calculated;
value $internalField;
}
left
{
type calculated;
value $internalField;
}
right
{
type calculated;
value $internalField;
}
bottom
{
type calculated;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0/leftSolid";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 0 0 1 0 0 0 ];
internalField uniform 300;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
left
{
type zeroGradient;
value $internalField;
}
right
{
type zeroGradient;
value $internalField;
}
bottom
{
type zeroGradient;
value $internalField;
}
top
{
type compressible::turbulentTemperatureRadCoupledMixed;
value $internalField;
Tnbr T;
kappaMethod solidThermo;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: 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 100000;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
left
{
type calculated;
value $internalField;
}
right
{
type calculated;
value $internalField;
}
top
{
type calculated;
value $internalField;
}
bottom
{
type calculated;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,11 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
cleanCase
rm -rf constant/solid1/polyMesh
rm -rf constant/solid2/polyMesh
#------------------------------------------------------------------------------

View File

@ -0,0 +1,11 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
#- Run in multi-region mode
runApplication -s solid1 blockMesh -region solid1
runApplication -s solid2 blockMesh -region solid2
runApplication $(getApplication)
#------------------------------------------------------------------------------

View File

@ -0,0 +1,20 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ 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);
// ************************************************************************* //

View File

@ -0,0 +1,24 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object regionProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
regions
(
fluid ()
solid (solid1 solid2)
);
// ************************************************************************* //

View File

@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object radiationProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -0,0 +1,52 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ 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
{
molWeight 50;
}
transport
{
kappa 80;
}
thermodynamics
{
Hf 0;
Cp 450;
}
equationOfState
{
rho 8000;
}
}
// ************************************************************************* //

View File

@ -0,0 +1 @@
../solid1/radiationProperties

View File

@ -0,0 +1 @@
../solid1/thermophysicalProperties

View File

@ -0,0 +1,61 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application chtMultiRegionFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 500;
deltaT 1;
//writeControl adjustable;
//writeInterval 0.1;
writeControl timeStep;
writeInterval 10;
purgeWrite 0;
writeFormat ascii;
writePrecision 8;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
//maxCo 0.6;
// Maximum diffusion number
//maxDi 10.0;
//adjustTimeStep yes;
//functions
//{
// #include "vtkWrite"
//}
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
//default Euler;
default steadyState;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
}
laplacianSchemes
{
default none;
laplacian(alpha,h) Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
// ************************************************************************* //

View File

@ -0,0 +1,53 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
h
{
solver PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0.1;
}
hFinal
{
$h;
tolerance 1e-06;
relTol 0;
}
}
PIMPLE
{
nNonOrthogonalCorrectors 0;
}
SIMPLE
{
nNonOrthogonalCorrectors 0;
}
relaxationFactors
{
equations
{
h 0.7;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,96 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 1;
vertices
(
(-0.1 0.00 -0.05)
( 0.1 0.00 -0.05)
( 0.1 0.04 -0.05)
(-0.1 0.04 -0.05)
(-0.1 0.00 0.05)
( 0.1 0.00 0.05)
( 0.1 0.04 0.05)
(-0.1 0.04 0.05)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (20 10 1) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
bottom
{
type mappedWall;
inGroups 1 ( wall );
sampleMode nearestPatchFace;
//sampleWorld solid2;
sampleRegion solid2;
samplePatch top;
faces
(
(1 5 4 0)
);
}
top
{
type wall;
faces
(
(3 7 6 2)
);
}
left
{
type wall;
faces
(
(0 4 7 3)
);
}
right
{
type wall;
faces
(
(2 6 5 1)
);
}
frontAndBack
{
type empty;
faces
(
(0 3 2 1)
(4 5 6 7)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1 @@
../fvSchemes

View File

@ -0,0 +1 @@
../fvSolution

View File

@ -0,0 +1,96 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 1;
vertices
(
(-0.1 -0.04 -0.05)
( 0.1 -0.04 -0.05)
( 0.1 0.00 -0.05)
(-0.1 0.00 -0.05)
(-0.1 -0.04 0.05)
( 0.1 -0.04 0.05)
( 0.1 0.00 0.05)
(-0.1 0.00 0.05)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (20 10 1) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
bottom
{
type wall;
faces
(
(1 5 4 0)
);
}
top
{
type mappedWall;
inGroups 1 ( wall );
sampleMode nearestPatchFace;
//sampleWorld solid1;
sampleRegion solid1;
samplePatch bottom;
faces
(
(3 7 6 2)
);
}
left
{
type wall;
faces
(
(0 4 7 3)
);
}
right
{
type wall;
faces
(
(2 6 5 1)
);
}
frontAndBack
{
type empty;
faces
(
(0 3 2 1)
(4 5 6 7)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1 @@
../fvSchemes

View File

@ -0,0 +1 @@
../fvSolution

View File

@ -0,0 +1,51 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0/leftSolid";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 0 0 1 0 0 0 ];
internalField uniform 300;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
left
{
type zeroGradient;
value $internalField;
}
right
{
type zeroGradient;
value $internalField;
}
bottom
{
type zeroGradient;
value $internalField;
}
top
{
type compressible::turbulentTemperatureRadCoupledMixed;
value $internalField;
Tnbr T;
kappaMethod solidThermo;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: 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 100000;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
left
{
type calculated;
value $internalField;
}
right
{
type calculated;
value $internalField;
}
top
{
type calculated;
value $internalField;
}
bottom
{
type calculated;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1 @@
../../solid1/constant/g

View File

@ -0,0 +1 @@
../../solid1/constant/radiationProperties

View File

@ -0,0 +1 @@
../../solid1/constant/thermophysicalProperties

View File

@ -0,0 +1,96 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2106 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 1;
vertices
(
(-0.1 -0.04 -0.05)
( 0.1 -0.04 -0.05)
( 0.1 0.00 -0.05)
(-0.1 0.00 -0.05)
(-0.1 -0.04 0.05)
( 0.1 -0.04 0.05)
( 0.1 0.00 0.05)
(-0.1 0.00 0.05)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (20 10 1) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
bottom
{
type wall;
faces
(
(1 5 4 0)
);
}
top
{
type mappedWall;
inGroups 1 ( wall );
sampleMode nearestPatchFace;
sampleWorld solid1;
sampleRegion region0;
samplePatch bottom;
faces
(
(3 7 6 2)
);
}
left
{
type wall;
faces
(
(0 4 7 3)
);
}
right
{
type wall;
faces
(
(2 6 5 1)
);
}
frontAndBack
{
type empty;
faces
(
(0 3 2 1)
(4 5 6 7)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1 @@
../../solid1/system/controlDict

View File

@ -0,0 +1 @@
../../solid1/system/decomposeParDict

View File

@ -0,0 +1 @@
../../solid1/system/fvSchemes

View File

@ -0,0 +1 @@
../../solid1/system/fvSolution

View File

@ -0,0 +1 @@
../../solid1/system/vtkWrite

View File

@ -64,8 +64,7 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
),
TnbrName_("undefined-Tnbr"),
thicknessLayers_(0),
kappaLayers_(0),
contactRes_(0)
kappaLayers_(0)
{
this->refValue() = 0.0;
this->refGrad() = 0.0;
@ -92,8 +91,7 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
),
TnbrName_(ptf.TnbrName_),
thicknessLayers_(ptf.thicknessLayers_),
kappaLayers_(ptf.kappaLayers_),
contactRes_(ptf.contactRes_)
kappaLayers_(ptf.kappaLayers_)
{}
@ -115,8 +113,7 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
),
TnbrName_(dict.get<word>("Tnbr")),
thicknessLayers_(0),
kappaLayers_(0),
contactRes_(0.0)
kappaLayers_(0)
{
if (!isA<mappedPatchBase>(this->patch().patch()))
{
@ -138,16 +135,6 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
if (dict.readIfPresent("thicknessLayers", thicknessLayers_))
{
dict.readEntry("kappaLayers", kappaLayers_);
if (thicknessLayers_.size() > 0)
{
// Calculate effective thermal resistance by harmonic averaging
forAll(thicknessLayers_, iLayer)
{
contactRes_ += thicknessLayers_[iLayer]/kappaLayers_[iLayer];
}
contactRes_ = 1.0/contactRes_;
}
}
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
@ -200,8 +187,7 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
),
TnbrName_(wtcsf.TnbrName_),
thicknessLayers_(wtcsf.thicknessLayers_),
kappaLayers_(wtcsf.kappaLayers_),
contactRes_(wtcsf.contactRes_)
kappaLayers_(wtcsf.kappaLayers_)
{}
@ -221,8 +207,7 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
),
TnbrName_(wtcsf.TnbrName_),
thicknessLayers_(wtcsf.thicknessLayers_),
kappaLayers_(wtcsf.kappaLayers_),
contactRes_(wtcsf.contactRes_)
kappaLayers_(wtcsf.kappaLayers_)
{}
@ -249,12 +234,20 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs()
);
const tmp<scalarField> myKDelta = kappa(*this)*patch().deltaCoeffs();
tmp<scalarField> nbrIntFld;
tmp<scalarField> nbrKDelta;
//Pout<< "updateCoeffs() : mpp.sameWorld():" << mpp.sameWorld() << endl;
if (thicknessLayers_.size() > 0)
{
myKDelta.ref() = 1.0/myKDelta.ref();
forAll(thicknessLayers_, iLayer)
{
myKDelta.ref() += thicknessLayers_[iLayer]/kappaLayers_[iLayer];
}
myKDelta.ref() = 1.0/myKDelta.ref();
}
scalarField nbrIntFld;
scalarField nbrKDelta;
if (mpp.sameWorld())
{
// Same world so lookup
@ -275,51 +268,19 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs()
)
);
if (contactRes_ == 0.0)
{
// Get neighbour internal data in local order. Does all
// comms/reordering already
nbrIntFld = this->mappedInternalField();
// Calculate neighbour weighting (in neighbouring ordering)
nbrKDelta = nbrField.kappa(nbrField)*nbrPatch.deltaCoeffs();
}
else
{
// Get neighbour patch values
nbrIntFld = new scalarField(nbrField);
// Comms/reorder to local
distribute(this->internalField().name(), nbrIntFld.ref());
// Constant neighbour weighting. Reorder/comms below
nbrKDelta = new scalarField(nbrField.size(), contactRes_);
}
// Swap to obtain full local values of neighbour K*delta
nbrIntFld = nbrField.patchInternalField();
nbrKDelta = nbrField.kappa(nbrField)*nbrPatch.deltaCoeffs();
}
else
{
// Different world so use my region,patch. Distribution below will
// do the reordering
if (contactRes_ == 0.0)
{
nbrIntFld = this->mappedInternalField();
nbrKDelta = new scalarField(myKDelta());
}
else
{
nbrIntFld = *this;
nbrKDelta = new scalarField(this->size(), contactRes_);
}
// do the reordering.
nbrIntFld = patchInternalField();
nbrKDelta = myKDelta.ref();
}
//Pout<< "updateCoeffs() : nbrIntFld:" << flatOutput(nbrIntFld()) << endl;
//Pout<< "updateCoeffs() : nbrKDelta BEFORE:" << flatOutput(nbrKDelta())
// << endl;
distribute(this->internalField().name() + "_weights", nbrKDelta.ref());
//Pout<< "updateCoeffs() : nbrKDelta AFTER:" << flatOutput(nbrKDelta())
// << endl;
//Pout<< "updateCoeffs() : myKDelta:" << flatOutput(myKDelta())
// << endl;
distribute(this->internalField().name() + "_value", nbrIntFld);
distribute(this->internalField().name() + "_weights", nbrKDelta);
// Both sides agree on
@ -337,9 +298,9 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs()
// - refValue = neighbour value
// - mixFraction = nbrKDelta / (nbrKDelta + myKDelta())
this->refValue() = nbrIntFld();
this->refValue() = nbrIntFld;
this->refGrad() = 0.0;
this->valueFraction() = nbrKDelta()/(nbrKDelta() + myKDelta());
this->valueFraction() = nbrKDelta/(nbrKDelta + myKDelta());
mixedFvPatchScalarField::updateCoeffs();

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -113,9 +114,6 @@ class turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
//- Conductivity of layers
scalarList kappaLayers_;
//- Total contact resistance
scalar contactRes_;
// Private member functions

View File

@ -32,6 +32,7 @@ License
#include "volFields.H"
#include "mappedPatchBase.H"
#include "basicThermo.H"
#include "mappedPatchFieldBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -58,6 +59,11 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField
"undefined-K",
"undefined-alpha"
),
mappedPatchFieldBase<scalar>
(
mappedPatchFieldBase<scalar>::mapper(p, iF),
*this
),
TnbrName_("undefined-Tnbr"),
qrNbrName_("undefined-qrNbr"),
qrName_("undefined-qr"),
@ -83,6 +89,12 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField
:
mixedFvPatchScalarField(psf, p, iF, mapper),
temperatureCoupledBase(patch(), psf),
mappedPatchFieldBase<scalar>
(
mappedPatchFieldBase<scalar>::mapper(p, iF),
*this,
psf
),
TnbrName_(psf.TnbrName_),
qrNbrName_(psf.qrNbrName_),
qrName_(psf.qrName_),
@ -102,6 +114,12 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField
:
mixedFvPatchScalarField(p, iF),
temperatureCoupledBase(patch(), dict),
mappedPatchFieldBase<scalar>
(
mappedPatchFieldBase<scalar>::mapper(p, iF),
*this,
dict
),
TnbrName_(dict.getOrDefault<word>("Tnbr", "T")),
qrNbrName_(dict.getOrDefault<word>("qrNbr", "none")),
qrName_(dict.getOrDefault<word>("qr", "none")),
@ -122,16 +140,6 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField
if (dict.readIfPresent("thicknessLayers", thicknessLayers_))
{
dict.readEntry("kappaLayers", kappaLayers_);
// if (thicknessLayers_.size() > 0)
// {
// // Calculate effective thermal resistance by harmonic averaging
// forAll(thicknessLayers_, iLayer)
// {
// contactRes_ += thicknessLayers_[iLayer]/kappaLayers_[iLayer];
// }
// contactRes_ = 1.0/contactRes_;
// }
}
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
@ -176,6 +184,35 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField
:
mixedFvPatchScalarField(psf, iF),
temperatureCoupledBase(patch(), psf),
mappedPatchFieldBase<scalar>
(
mappedPatchFieldBase<scalar>::mapper(patch(), iF),
*this,
psf
),
TnbrName_(psf.TnbrName_),
qrNbrName_(psf.qrNbrName_),
qrName_(psf.qrName_),
thicknessLayers_(psf.thicknessLayers_),
kappaLayers_(psf.kappaLayers_),
thermalInertia_(psf.thermalInertia_)
{}
turbulentTemperatureRadCoupledMixedFvPatchScalarField::
turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
const turbulentTemperatureRadCoupledMixedFvPatchScalarField& psf
)
:
mixedFvPatchScalarField(psf),
temperatureCoupledBase(patch(), psf),
mappedPatchFieldBase<scalar>
(
mappedPatchFieldBase<scalar>::mapper(patch(), psf.internalField()),
*this,
psf
),
TnbrName_(psf.TnbrName_),
qrNbrName_(psf.qrNbrName_),
qrName_(psf.qrName_),
@ -204,29 +241,14 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
// Get the coupling information from the mappedPatchBase
const label patchi = patch().index();
const mappedPatchBase& mpp =
refCast<const mappedPatchBase>(patch().patch());
const polyMesh& nbrMesh = mpp.sampleMesh();
const label samplePatchi = mpp.samplePolyPatch().index();
const fvPatch& nbrPatch =
refCast<const fvMesh>(nbrMesh).boundary()[samplePatchi];
mappedPatchFieldBase<scalar>::mapper
(
patch(),
this->internalField()
);
scalarField Tc(patchInternalField());
scalarField& Tp = *this;
const turbulentTemperatureRadCoupledMixedFvPatchScalarField&
nbrField = refCast
<const turbulentTemperatureRadCoupledMixedFvPatchScalarField>
(
nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_)
);
// Swap to obtain full local values of neighbour K*delta
scalarField TcNbr(nbrField.patchInternalField());
scalarField KDeltaNbr(nbrField.kappa(nbrField)*nbrPatch.deltaCoeffs());
mpp.distribute(KDeltaNbr);
mpp.distribute(TcNbr);
const scalarField Tc(patchInternalField());
const scalarField& Tp = *this;
scalarField KDelta(kappa(Tp)*patch().deltaCoeffs());
@ -240,6 +262,37 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
KDelta = 1.0/KDelta;
}
scalarField TcNbr;
scalarField KDeltaNbr;
if (mpp.sameWorld())
{
const polyMesh& nbrMesh = mpp.sampleMesh();
const label samplePatchi = mpp.samplePolyPatch().index();
const fvPatch& nbrPatch =
refCast<const fvMesh>(nbrMesh).boundary()[samplePatchi];
const auto& nbrField = refCast
<const turbulentTemperatureRadCoupledMixedFvPatchScalarField>
(
nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_)
);
// Swap to obtain full local values of neighbour K*delta
TcNbr = nbrField.patchInternalField();
KDeltaNbr = nbrField.kappa(nbrField)*nbrPatch.deltaCoeffs();
}
else
{
// Different world so use my region,patch. Distribution below will
// do the reordering.
TcNbr = patchInternalField();
KDeltaNbr = KDelta;
}
distribute(this->internalField().name() + "_value", TcNbr);
distribute(this->internalField().name() + "_weights", KDeltaNbr);
scalarField qr(Tp.size(), Zero);
if (qrName_ != "none")
{
@ -249,22 +302,46 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
scalarField qrNbr(Tp.size(), Zero);
if (qrNbrName_ != "none")
{
qrNbr = nbrPatch.lookupPatchField<volScalarField, scalar>(qrNbrName_);
mpp.distribute(qrNbr);
if (mpp.sameWorld())
{
const polyMesh& nbrMesh = mpp.sampleMesh();
const label samplePatchi = mpp.samplePolyPatch().index();
const fvPatch& nbrPatch =
refCast<const fvMesh>(nbrMesh).boundary()[samplePatchi];
qrNbr =
nbrPatch.lookupPatchField<volScalarField, scalar>(qrNbrName_);
}
else
{
qrNbr =
patch().lookupPatchField<volScalarField, scalar>(qrNbrName_);
}
distribute(qrNbrName_, qrNbr);
}
// inertia therm
if (thermalInertia_ && !mpp.sameWorld())
{
FatalErrorInFunction
<< "thermalInertia not supported in combination with multi-world"
<< exit(FatalError);
}
if (thermalInertia_)
{
const scalar dt = mesh.time().deltaTValue();
scalarField mCpDtNbr;
{
const polyMesh& nbrMesh = mpp.sampleMesh();
const basicThermo* thermo =
nbrMesh.findObject<basicThermo>(basicThermo::dictName);
if (thermo)
{
const label samplePatchi = mpp.samplePolyPatch().index();
const fvPatch& nbrPatch =
refCast<const fvMesh>(nbrMesh).boundary()[samplePatchi];
const scalarField& ppn =
thermo->p().boundaryField()[samplePatchi];
const scalarField& Tpn =
@ -354,8 +431,8 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
Info<< patch().boundaryMesh().mesh().name() << ':'
<< patch().name() << ':'
<< this->internalField().name() << " <- "
<< nbrMesh.name() << ':'
<< nbrPatch.name() << ':'
<< mpp.sampleRegion() << ':'
<< mpp.samplePatch() << ':'
<< this->internalField().name() << " :"
<< " heat transfer rate:" << Q
<< " walltemperature "
@ -415,6 +492,13 @@ beta() const
const mappedPatchBase& mpp =
refCast<const mappedPatchBase>(patch().patch());
if (!mpp.sameWorld())
{
FatalErrorInFunction
<< "coupled energy not supported in combination with multi-world"
<< exit(FatalError);
}
const label samplePatchi = mpp.samplePolyPatch().index();
const polyMesh& nbrMesh = mpp.sampleMesh();
@ -450,10 +534,16 @@ beta() const
tmp<scalarField> turbulentTemperatureRadCoupledMixedFvPatchScalarField::
deltaH() const
{
const mappedPatchBase& mpp =
refCast<const mappedPatchBase>(patch().patch());
if (!mpp.sameWorld())
{
FatalErrorInFunction
<< "coupled energy not supported in combination with multi-world"
<< exit(FatalError);
}
const polyMesh& nbrMesh = mpp.sampleMesh();
const basicThermo* nbrThermo =

View File

@ -83,6 +83,7 @@ SourceFiles
#include "mixedFvPatchFields.H"
#include "temperatureCoupledBase.H"
#include "scalarList.H"
#include "mappedPatchFieldBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -98,7 +99,8 @@ namespace compressible
class turbulentTemperatureRadCoupledMixedFvPatchScalarField
:
public mixedFvPatchScalarField,
public temperatureCoupledBase
public temperatureCoupledBase,
public mappedPatchFieldBase<scalar>
{
// Private Data
@ -178,6 +180,12 @@ public:
const fvPatchFieldMapper&
);
//- Construct as copy
turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
const turbulentTemperatureRadCoupledMixedFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{