ENH: Adding isotropic flag to solidThermo for transport.

Modified chtMultiRegionFoam and chtMultiRegionSimpleFoam to work with
anisotropic heat transfer conductivity
This commit is contained in:
sergio
2013-01-22 13:04:44 +00:00
parent 464756f805
commit 1bd6b1bbb7
14 changed files with 103 additions and 72 deletions

View File

@ -40,13 +40,14 @@ Description
#include "rhoThermo.H"
#include "turbulenceModel.H"
#include "fixedGradientFvPatchFields.H"
#include "zeroGradientFvPatchFields.H"
#include "regionProperties.H"
#include "compressibleCourantNo.H"
#include "solidRegionDiffNo.H"
#include "solidThermo.H"
#include "radiationModel.H"
#include "fvIOoptionList.H"
#include "coordinateSystem.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -37,6 +37,7 @@ Description
#include "solidThermo.H"
#include "radiationModel.H"
#include "fvIOoptionList.H"
#include "coordinateSystem.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -3,7 +3,9 @@
{
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)
);

View File

@ -1,4 +1,5 @@
// Initialise solid field pointer lists
PtrList<coordinateSystem> coordinates(solidRegions.size());
PtrList<solidThermo> thermos(solidRegions.size());
PtrList<radiation::radiationModel> radiations(solidRegions.size());
PtrList<fv::IOoptionList> solidHeatSources(solidRegions.size());
@ -23,6 +24,16 @@
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
(
"betavSolid",

View File

@ -8,10 +8,36 @@
tmp<volScalarField> tcp = thermo.Cp();
const volScalarField& cp = tcp();
tmp<volScalarField> talpha = thermo.alpha();
const volScalarField& alpha = talpha();
tmp<volScalarField> tkappa = thermo.kappa();
const volScalarField& kappa = tkappa();
tmp<volSymmTensorField> tAnialpha;
if (!thermo.isotropic())
{
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();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -56,38 +56,4 @@ Foam::scalar Foam::solidRegionDiffNo
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;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -41,15 +41,6 @@ namespace Foam
const volScalarField& Cprho,
const volScalarField& kappa
);
scalar solidRegionDiffNo
(
const fvMesh& mesh,
const Time& runTime,
const volScalarField& Cprho,
const volSymmTensorField& kappa
);
}
#endif

View File

@ -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"
DiNum = max
(
solidRegionDiffNo
(
solidRegions[i],
runTime,
rho*cp,
kappa
),
DiNum
);
magKappa = thermo.kappa();
}
else
{
magKappa = mag(thermo.Kappa());
}
DiNum = max
(
solidRegionDiffNo
(
solidRegions[i],
runTime,
rho*cp,
magKappa()
),
DiNum
);
}

View File

@ -9,7 +9,11 @@ if (finalIter)
tmp<fvScalarMatrix> hEqn
(
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)
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -111,6 +111,9 @@ public:
return "constAnIso<" + Thermo::typeName() + '>';
}
//- Is the thermal conductivity isotropic
static const bool isotropic = false;
//- Isotropic thermal conductivity [W/mK]
inline scalar kappa(const scalar p, const scalar T) const;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -112,6 +112,9 @@ public:
return "constIso<" + Thermo::typeName() + '>';
}
//- Is the thermal conductivity isotropic
static const bool isotropic = true;
//- Isotropic thermal conductivity [W/mK]
inline scalar kappa(const scalar p, const scalar T) const;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -121,6 +121,9 @@ public:
return "exponential<" + Thermo::typeName() + '>';
}
//- Is the thermal conductivity isotropic
static const bool isotropic = true;
//- Thermal conductivity [W/mK]
inline scalar kappa(const scalar p, const scalar T) const;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -99,6 +99,12 @@ public:
//- Anisotropic thermal conductivity [W/m/K]
virtual tmp<volVectorField> Kappa() const;
//- Return true if thermal conductivity is isotropic
virtual bool isotropic() const
{
return MixtureType::thermoType::isotropic;
}
// Per patch calculation

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -144,6 +144,9 @@ public:
//- Thermal conductivity [W/m/K]
virtual tmp<volVectorField> Kappa() const = 0;
//- Return true if thermal conductivity is isotropic
virtual bool isotropic() const = 0;
// Per patch calculation