mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Adding isotropic flag to solidThermo for transport.
Modified chtMultiRegionFoam and chtMultiRegionSimpleFoam to work with anisotropic heat transfer conductivity
This commit is contained in:
@ -40,13 +40,14 @@ Description
|
|||||||
#include "rhoThermo.H"
|
#include "rhoThermo.H"
|
||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "fixedGradientFvPatchFields.H"
|
#include "fixedGradientFvPatchFields.H"
|
||||||
|
#include "zeroGradientFvPatchFields.H"
|
||||||
#include "regionProperties.H"
|
#include "regionProperties.H"
|
||||||
#include "compressibleCourantNo.H"
|
#include "compressibleCourantNo.H"
|
||||||
#include "solidRegionDiffNo.H"
|
#include "solidRegionDiffNo.H"
|
||||||
#include "solidThermo.H"
|
#include "solidThermo.H"
|
||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
|
#include "coordinateSystem.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -37,6 +37,7 @@ Description
|
|||||||
#include "solidThermo.H"
|
#include "solidThermo.H"
|
||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
#include "fvIOoptionList.H"
|
#include "fvIOoptionList.H"
|
||||||
|
#include "coordinateSystem.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,9 @@
|
|||||||
{
|
{
|
||||||
fvScalarMatrix hEqn
|
fvScalarMatrix hEqn
|
||||||
(
|
(
|
||||||
- fvm::laplacian(betav*alpha, h, "laplacian(alpha,h)")
|
thermo.isotropic()
|
||||||
|
? -fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)")
|
||||||
|
: -fvm::laplacian(betav*tAnialpha(), h, "laplacian(alpha,h)")
|
||||||
+ fvOptions(rho, h)
|
+ fvOptions(rho, h)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
// Initialise solid field pointer lists
|
// Initialise solid field pointer lists
|
||||||
|
PtrList<coordinateSystem> coordinates(solidRegions.size());
|
||||||
PtrList<solidThermo> thermos(solidRegions.size());
|
PtrList<solidThermo> thermos(solidRegions.size());
|
||||||
PtrList<radiation::radiationModel> radiations(solidRegions.size());
|
PtrList<radiation::radiationModel> radiations(solidRegions.size());
|
||||||
PtrList<fv::IOoptionList> solidHeatSources(solidRegions.size());
|
PtrList<fv::IOoptionList> solidHeatSources(solidRegions.size());
|
||||||
@ -23,6 +24,16 @@
|
|||||||
new fv::IOoptionList(solidRegions[i])
|
new fv::IOoptionList(solidRegions[i])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!thermos[i].isotropic())
|
||||||
|
{
|
||||||
|
Info<< " Adding coordinateSystems\n" << endl;
|
||||||
|
coordinates.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
coordinateSystem::New(solidRegions[i], thermos[i])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
IOobject betavSolidIO
|
IOobject betavSolidIO
|
||||||
(
|
(
|
||||||
"betavSolid",
|
"betavSolid",
|
||||||
|
|||||||
@ -8,10 +8,36 @@
|
|||||||
tmp<volScalarField> tcp = thermo.Cp();
|
tmp<volScalarField> tcp = thermo.Cp();
|
||||||
const volScalarField& cp = tcp();
|
const volScalarField& cp = tcp();
|
||||||
|
|
||||||
tmp<volScalarField> talpha = thermo.alpha();
|
tmp<volSymmTensorField> tAnialpha;
|
||||||
const volScalarField& alpha = talpha();
|
|
||||||
tmp<volScalarField> tkappa = thermo.kappa();
|
if (!thermo.isotropic())
|
||||||
const volScalarField& kappa = tkappa();
|
{
|
||||||
|
tmp<volVectorField> tkappaCp = thermo.Kappa()/cp;
|
||||||
|
|
||||||
|
const coordinateSystem& coodSys = coordinates[i];
|
||||||
|
tAnialpha =
|
||||||
|
tmp<volSymmTensorField>
|
||||||
|
(
|
||||||
|
new volSymmTensorField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Anialpha",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
tkappaCp().dimensions(),
|
||||||
|
zeroGradientFvPatchVectorField::typeName
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
volSymmTensorField& Anialpha = tAnialpha();
|
||||||
|
Anialpha.internalField() = coodSys.R().transformVector(tkappaCp());
|
||||||
|
Anialpha.correctBoundaryConditions();
|
||||||
|
}
|
||||||
|
|
||||||
volScalarField& h = thermo.he();
|
volScalarField& h = thermo.he();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -56,38 +56,4 @@ Foam::scalar Foam::solidRegionDiffNo
|
|||||||
return DiNum;
|
return DiNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::solidRegionDiffNo
|
|
||||||
(
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const Time& runTime,
|
|
||||||
const volScalarField& Cprho,
|
|
||||||
const volSymmTensorField& kappadirectional
|
|
||||||
)
|
|
||||||
{
|
|
||||||
scalar DiNum = 0.0;
|
|
||||||
scalar meanDiNum = 0.0;
|
|
||||||
|
|
||||||
volScalarField kappa(mag(kappadirectional));
|
|
||||||
|
|
||||||
//- Take care: can have fluid domains with 0 cells so do not test for
|
|
||||||
// zero internal faces.
|
|
||||||
surfaceScalarField kapparhoCpbyDelta
|
|
||||||
(
|
|
||||||
mesh.surfaceInterpolation::deltaCoeffs()
|
|
||||||
* fvc::interpolate(kappa)
|
|
||||||
/ fvc::interpolate(Cprho)
|
|
||||||
);
|
|
||||||
|
|
||||||
DiNum = gMax(kapparhoCpbyDelta.internalField())*runTime.deltaT().value();
|
|
||||||
|
|
||||||
meanDiNum = (average(kapparhoCpbyDelta)).value()*runTime.deltaT().value();
|
|
||||||
|
|
||||||
Info<< "Region: " << mesh.name() << " Diffusion Number mean: " << meanDiNum
|
|
||||||
<< " max: " << DiNum << endl;
|
|
||||||
|
|
||||||
return DiNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -41,15 +41,6 @@ namespace Foam
|
|||||||
const volScalarField& Cprho,
|
const volScalarField& Cprho,
|
||||||
const volScalarField& kappa
|
const volScalarField& kappa
|
||||||
);
|
);
|
||||||
|
|
||||||
scalar solidRegionDiffNo
|
|
||||||
(
|
|
||||||
const fvMesh& mesh,
|
|
||||||
const Time& runTime,
|
|
||||||
const volScalarField& Cprho,
|
|
||||||
const volSymmTensorField& kappa
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -1,18 +1,29 @@
|
|||||||
scalar DiNum = -GREAT;
|
scalar DiNum = -GREAT;
|
||||||
|
|
||||||
forAll(solidRegions, i)
|
forAll(solidRegions, i)
|
||||||
|
{
|
||||||
|
#include "setRegionSolidFields.H"
|
||||||
|
|
||||||
|
tmp<volScalarField> magKappa;
|
||||||
|
if (thermo.isotropic())
|
||||||
{
|
{
|
||||||
#include "setRegionSolidFields.H"
|
magKappa = thermo.kappa();
|
||||||
|
|
||||||
DiNum = max
|
|
||||||
(
|
|
||||||
solidRegionDiffNo
|
|
||||||
(
|
|
||||||
solidRegions[i],
|
|
||||||
runTime,
|
|
||||||
rho*cp,
|
|
||||||
kappa
|
|
||||||
),
|
|
||||||
DiNum
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
magKappa = mag(thermo.Kappa());
|
||||||
|
}
|
||||||
|
|
||||||
|
DiNum = max
|
||||||
|
(
|
||||||
|
solidRegionDiffNo
|
||||||
|
(
|
||||||
|
solidRegions[i],
|
||||||
|
runTime,
|
||||||
|
rho*cp,
|
||||||
|
magKappa()
|
||||||
|
),
|
||||||
|
DiNum
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@ -9,7 +9,11 @@ if (finalIter)
|
|||||||
tmp<fvScalarMatrix> hEqn
|
tmp<fvScalarMatrix> hEqn
|
||||||
(
|
(
|
||||||
fvm::ddt(betav*rho, h)
|
fvm::ddt(betav*rho, h)
|
||||||
- fvm::laplacian(betav*alpha, h, "laplacian(alpha,h)")
|
- (
|
||||||
|
thermo.isotropic()
|
||||||
|
? fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)")
|
||||||
|
: fvm::laplacian(betav*tAnialpha(), h, "laplacian(alpha,h)")
|
||||||
|
)
|
||||||
==
|
==
|
||||||
fvOptions(rho, h)
|
fvOptions(rho, h)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -111,6 +111,9 @@ public:
|
|||||||
return "constAnIso<" + Thermo::typeName() + '>';
|
return "constAnIso<" + Thermo::typeName() + '>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Is the thermal conductivity isotropic
|
||||||
|
static const bool isotropic = false;
|
||||||
|
|
||||||
//- Isotropic thermal conductivity [W/mK]
|
//- Isotropic thermal conductivity [W/mK]
|
||||||
inline scalar kappa(const scalar p, const scalar T) const;
|
inline scalar kappa(const scalar p, const scalar T) const;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -112,6 +112,9 @@ public:
|
|||||||
return "constIso<" + Thermo::typeName() + '>';
|
return "constIso<" + Thermo::typeName() + '>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Is the thermal conductivity isotropic
|
||||||
|
static const bool isotropic = true;
|
||||||
|
|
||||||
//- Isotropic thermal conductivity [W/mK]
|
//- Isotropic thermal conductivity [W/mK]
|
||||||
inline scalar kappa(const scalar p, const scalar T) const;
|
inline scalar kappa(const scalar p, const scalar T) const;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -121,6 +121,9 @@ public:
|
|||||||
return "exponential<" + Thermo::typeName() + '>';
|
return "exponential<" + Thermo::typeName() + '>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Is the thermal conductivity isotropic
|
||||||
|
static const bool isotropic = true;
|
||||||
|
|
||||||
//- Thermal conductivity [W/mK]
|
//- Thermal conductivity [W/mK]
|
||||||
inline scalar kappa(const scalar p, const scalar T) const;
|
inline scalar kappa(const scalar p, const scalar T) const;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -99,6 +99,12 @@ public:
|
|||||||
//- Anisotropic thermal conductivity [W/m/K]
|
//- Anisotropic thermal conductivity [W/m/K]
|
||||||
virtual tmp<volVectorField> Kappa() const;
|
virtual tmp<volVectorField> Kappa() const;
|
||||||
|
|
||||||
|
//- Return true if thermal conductivity is isotropic
|
||||||
|
virtual bool isotropic() const
|
||||||
|
{
|
||||||
|
return MixtureType::thermoType::isotropic;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Per patch calculation
|
// Per patch calculation
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -144,6 +144,9 @@ public:
|
|||||||
//- Thermal conductivity [W/m/K]
|
//- Thermal conductivity [W/m/K]
|
||||||
virtual tmp<volVectorField> Kappa() const = 0;
|
virtual tmp<volVectorField> Kappa() const = 0;
|
||||||
|
|
||||||
|
//- Return true if thermal conductivity is isotropic
|
||||||
|
virtual bool isotropic() const = 0;
|
||||||
|
|
||||||
|
|
||||||
// Per patch calculation
|
// Per patch calculation
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user