solidThermophysicalTransportModel: new thermophysical transport model for solids

to handle isotropic and anisotropic is a consistent, general and extensible
manner, replacing the horrible hacks which were in solidThermo.

This is entirely consistent with thermophysicalTransportModel for fluids and
provides the q() and divq() for the solid energy conservation equations.  The
transport model and properties are specified in the optional
thermophysicalTransport dictionary, the default model being isotropic if this
dictionary file is not present, thus providing complete backward-compatibility
for the common isotropic cases.

Anisotropic thermal conductivity is now handled in a much more general manner by
the anisotropic model:

Class
    Foam::solidThermophysicalTransportModels::anisotropic

Description
    Solid thermophysical transport model for anisotropic thermal conductivity

    The anisotropic thermal conductivity field is evaluated from the solid
    material anisotropic kappa specified in the physicalProperties dictionary
    transformed into the global coordinate system using default
    coordinate system and optionally additional coordinate systems specified
    per-zone in the thermophysicalProperties dictionary.

Usage
    Example of the anisotropic thermal conductivity specification in
    thermophysicalProperties with two zone-based coordinate systems in
    addition to the default:

    \verbatim
    model anisotropic;

    // Default coordinate system
    coordinateSystem
    {
        type        cartesian;
        origin      (0 0 0);
        coordinateRotation
        {
            type        cylindrical;
            e3          (1 0 0);
        }
    }

    // Optional zone coordinate systems
    zones
    {
        coil1
        {
            type        cartesian;
            origin      (0.1 0.2 0.7);
            coordinateRotation
            {
                type        cylindrical;
                e3          (0.5 0.866 0);
            }
        }

        coil2
        {
            type        cartesian;
            origin      (0.4 0.5 1);
            coordinateRotation
            {
                type        cylindrical;
                e3          (0.866 0.5 0);
            }
        }
    }
    \endverbatim

This development required substantial rationalisation of solidThermo,
coordinateSystems and updates to the solid solver module, solidDisplacementFoam,
the wallHeatFlux functionObject, thermalBaffle and all coupled thermal boundary
conditions.
This commit is contained in:
Henry Weller
2022-10-19 16:45:00 +01:00
parent cc868b677f
commit cdaaa61987
80 changed files with 1579 additions and 615 deletions

View File

@ -17,7 +17,7 @@ EXE_LIBS = \
-lmomentumTransportModels \ -lmomentumTransportModels \
-lcompressibleMomentumTransportModels \ -lcompressibleMomentumTransportModels \
-lthermophysicalTransportModels \ -lthermophysicalTransportModels \
-lfluidThermophysicalModels \ -lcoupledThermophysicalTransportModels \
-lmulticomponentThermophysicalModels \ -lmulticomponentThermophysicalModels \
-lspecie \ -lspecie \
-llaminarFlameSpeedModels \ -llaminarFlameSpeedModels \

View File

@ -41,7 +41,7 @@ EXE_LIBS = \
-lspecie \ -lspecie \
-lmomentumTransportModels \ -lmomentumTransportModels \
-lcompressibleMomentumTransportModels \ -lcompressibleMomentumTransportModels \
-lthermophysicalTransportModels \ -lcoupledThermophysicalTransportModels \
-llaminarFlameSpeedModels \ -llaminarFlameSpeedModels \
-lfiniteVolume \ -lfiniteVolume \
-lfvModels \ -lfvModels \

View File

@ -18,5 +18,5 @@ EXE_LIBS = \
-lrhoCentralFoam \ -lrhoCentralFoam \
-lmomentumTransportModels \ -lmomentumTransportModels \
-lcompressibleMomentumTransportModels \ -lcompressibleMomentumTransportModels \
-lthermophysicalTransportModels \ -lcoupledThermophysicalTransportModels \
-lmeshTools -lmeshTools

View File

@ -16,7 +16,7 @@ EXE_LIBS = \
-lspecie \ -lspecie \
-lmomentumTransportModels \ -lmomentumTransportModels \
-lcompressibleMomentumTransportModels \ -lcompressibleMomentumTransportModels \
-lthermophysicalTransportModels \ -lcoupledThermophysicalTransportModels \
-lfiniteVolume \ -lfiniteVolume \
-lsampling \ -lsampling \
-lmeshTools \ -lmeshTools \

View File

@ -18,4 +18,4 @@ EXE_LIBS = \
-lspecie \ -lspecie \
-lmomentumTransportModels \ -lmomentumTransportModels \
-lcompressibleMomentumTransportModels \ -lcompressibleMomentumTransportModels \
-lthermophysicalTransportModels -lcoupledThermophysicalTransportModels

View File

@ -17,7 +17,7 @@ LIB_LIBS = \
-lfluidThermophysicalModels \ -lfluidThermophysicalModels \
-lmomentumTransportModels \ -lmomentumTransportModels \
-lcompressibleMomentumTransportModels \ -lcompressibleMomentumTransportModels \
-lthermophysicalTransportModels \ -lcoupledThermophysicalTransportModels \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-lsampling \ -lsampling \

View File

@ -28,7 +28,7 @@ LIB_LIBS = \
-lmulticomponentThermophysicalModels \ -lmulticomponentThermophysicalModels \
-lmomentumTransportModels \ -lmomentumTransportModels \
-lcompressibleMomentumTransportModels \ -lcompressibleMomentumTransportModels \
-lthermophysicalTransportModels \ -lcoupledThermophysicalTransportModels \
-lfluidMulticomponentThermophysicalTransportModels \ -lfluidMulticomponentThermophysicalTransportModels \
-lfiniteVolume \ -lfiniteVolume \
-lfvModels \ -lfvModels \

View File

@ -2,13 +2,14 @@ EXE_INC = \
-I$(LIB_SRC)/physicalProperties/lnInclude \ -I$(LIB_SRC)/physicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/finiteVolume/cfdTools \ -I$(LIB_SRC)/ThermophysicalTransportModels/solidThermophysicalTransportModels/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude -I$(LIB_SRC)/sampling/lnInclude
LIB_LIBS = \ LIB_LIBS = \
-lsolidThermo \ -lsolidThermo \
-lsolidThermophysicalTransportModels \
-lspecie \ -lspecie \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \

View File

@ -76,9 +76,6 @@ void Foam::solvers::solid::correctDiNum()
} }
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::solvers::solid::solid(fvMesh& mesh) Foam::solvers::solid::solid(fvMesh& mesh)
@ -90,6 +87,8 @@ Foam::solvers::solid::solid(fvMesh& mesh)
T(thermo.T()), T(thermo.T()),
thermophysicalTransport(solidThermophysicalTransportModel::New(thermo)),
DiNum(0) DiNum(0)
{ {
// Read the controls // Read the controls
@ -174,7 +173,7 @@ void Foam::solvers::solid::thermophysicalPredictor()
fvScalarMatrix eEqn fvScalarMatrix eEqn
( (
fvm::ddt(rho, e) fvm::ddt(rho, e)
+ thermo.divq(e) + thermophysicalTransport->divq(e)
== ==
fvModels().source(rho, e) fvModels().source(rho, e)
); );

View File

@ -38,7 +38,7 @@ SourceFiles
#define solid_H #define solid_H
#include "solver.H" #include "solver.H"
#include "solidThermo.H" #include "solidThermophysicalTransportModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -74,6 +74,12 @@ protected:
volScalarField& T; volScalarField& T;
// Thermophysical transport
//- Pointer to the solid thermophysical transport model
autoPtr<solidThermophysicalTransportModel> thermophysicalTransport;
// Time-step controls // Time-step controls
scalar DiNum; scalar DiNum;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -349,7 +349,7 @@ public:
// Transport // Transport
//- Effective thermal turbulent diffusivity for temperature //- Effective thermal turbulent conductivity
// of mixture for patch [W/m/K] // of mixture for patch [W/m/K]
virtual tmp<scalarField> kappaEff(const label patchi) const = 0; virtual tmp<scalarField> kappaEff(const label patchi) const = 0;

View File

@ -6,13 +6,15 @@ EXE_INC = \
-I$(LIB_SRC)/physicalProperties/lnInclude \ -I$(LIB_SRC)/physicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/ThermophysicalTransportModels/solidThermophysicalTransportModels/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude -I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \
-lsolidThermo \ -lsolidThermo \
-lsolidDisplacementThermo \ -lsolidDisplacementThermo \
-lsolidThermophysicalTransportModels \
-lfiniteVolume \
-lmeshTools \
-lfvModels \ -lfvModels \
-lfvConstraints \ -lfvConstraints
-lmeshTools

View File

@ -2,6 +2,13 @@ Info<< "Reading thermophysical properties\n" << endl;
solidDisplacementThermo thermo(mesh); solidDisplacementThermo thermo(mesh);
autoPtr<solidThermophysicalTransportModel> thermophysicalTransport;
if (thermo.thermalStress())
{
thermophysicalTransport = solidThermophysicalTransportModel::New(thermo);
}
const volScalarField& E(thermo.E()); const volScalarField& E(thermo.E());
const volScalarField& nu(thermo.nu()); const volScalarField& nu(thermo.nu());

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -37,6 +37,7 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "solidDisplacementThermo.H" #include "solidDisplacementThermo.H"
#include "solidThermophysicalTransportModel.H"
#include "fvModels.H" #include "fvModels.H"
#include "fvConstraints.H" #include "fvConstraints.H"
@ -76,7 +77,7 @@ int main(int argc, char *argv[])
fvScalarMatrix TEqn fvScalarMatrix TEqn
( (
fvm::ddt(rho, Cp, T) fvm::ddt(rho, Cp, T)
+ thermo.divq(T) + thermophysicalTransport->divq(T)
== ==
fvModels.source(rho*Cp, T) fvModels.source(rho*Cp, T)
); );

View File

@ -61,7 +61,7 @@ class solidDisplacementThermo
//- Heat capacity at constant pressure [J/kg/K] //- Heat capacity at constant pressure [J/kg/K]
volScalarField Cp_; volScalarField Cp_;
//- Thermal diffusivity for temperature [W/m/K] //- Thermal conductivity [W/m/K]
volScalarField kappa_; volScalarField kappa_;
//- Youngs modulus [Pa] //- Youngs modulus [Pa]
@ -176,7 +176,7 @@ public:
// Access to transport state variables // Access to transport state variables
//- Thermal diffusivity for temperature of mixture [W/m/K] //- Thermal conductivity of mixture [W/m/K]
virtual const volScalarField& kappa() const; virtual const volScalarField& kappa() const;
@ -314,7 +314,7 @@ public:
//- Thermal diffusivity for energy of mixture for patch [kg/m/s] //- Thermal diffusivity for energy of mixture for patch [kg/m/s]
virtual tmp<scalarField> alphahe(const label patchi) const; virtual tmp<scalarField> alphahe(const label patchi) const;
//- Effective thermal turbulent diffusivity for temperature //- Effective thermal turbulent conductivity
// of mixture [W/m/K] // of mixture [W/m/K]
virtual tmp<volScalarField> kappaEff virtual tmp<volScalarField> kappaEff
( (
@ -327,7 +327,7 @@ public:
const volScalarField& alphat const volScalarField& alphat
) const; ) const;
//- Effective thermal turbulent diffusivity for temperature //- Effective thermal turbulent conductivity
// of mixture for patch [W/m/K] // of mixture for patch [W/m/K]
virtual tmp<scalarField> kappaEff virtual tmp<scalarField> kappaEff
( (

View File

@ -6,6 +6,7 @@ EXE_INC = \
-I$(LIB_SRC)/physicalProperties/lnInclude \ -I$(LIB_SRC)/physicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/ThermophysicalTransportModels/solidThermophysicalTransportModels/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude -I$(LIB_SRC)/meshTools/lnInclude
@ -13,4 +14,5 @@ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lsolidThermo \ -lsolidThermo \
-lsolidDisplacementThermo \ -lsolidDisplacementThermo \
-lsolidThermophysicalTransportModels \
-lmeshTools -lmeshTools

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -26,8 +26,7 @@ Application
Description Description
Steady-state segregated finite-volume solver of linear-elastic, Steady-state segregated finite-volume solver of linear-elastic,
small-strain deformation of a solid body, with optional thermal small-strain deformation of a solid body.
diffusion and thermal stresses.
Simple linear elasticity structural analysis code. Simple linear elasticity structural analysis code.
Solves for the displacement vector field D, also generating the Solves for the displacement vector field D, also generating the
@ -37,6 +36,7 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "solidDisplacementThermo.H" #include "solidDisplacementThermo.H"
#include "solidThermophysicalTransportModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -307,7 +307,7 @@ protected:
//- Is the mesh moving //- Is the mesh moving
bool moving_; bool moving_;
//- Is the mesh topology changing //- Has the mesh topology changed
bool topoChanged_; bool topoChanged_;
@ -528,7 +528,7 @@ public:
return moving_; return moving_;
} }
//- Is mesh topology changing //- Has the mesh topology changed
bool topoChanged() const bool topoChanged() const
{ {
return topoChanged_; return topoChanged_;

View File

@ -8,5 +8,7 @@ wmake $targetType
wmake $targetType fluidMulticomponentThermo wmake $targetType fluidMulticomponentThermo
wmake $targetType phaseFluidThermo wmake $targetType phaseFluidThermo
wmake $targetType phaseFluidMulticomponentThermo wmake $targetType phaseFluidMulticomponentThermo
wmake $targetType solidThermophysicalTransportModels
wmake $targetType coupledThermophysicalTransportModels
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -1,9 +1,6 @@
thermophysicalTransportModel/thermophysicalTransportModel.C thermophysicalTransportModel/thermophysicalTransportModel.C
BCs = derivedFvPatchFields BCs = derivedFvPatchFields
$(BCs)/externalTemperature/externalTemperatureFvPatchScalarField.C
$(BCs)/temperatureCoupledBase/temperatureCoupledBase.C
$(BCs)/coupledTemperature/coupledTemperatureFvPatchScalarField.C
$(BCs)/thermalBaffle1D/thermalBaffle1DFvPatchScalarFields.C $(BCs)/thermalBaffle1D/thermalBaffle1DFvPatchScalarFields.C
$(BCs)/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C $(BCs)/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C
$(BCs)/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C $(BCs)/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C

View File

@ -0,0 +1,5 @@
externalTemperature/externalTemperatureFvPatchScalarField.C
patchKappa/patchKappa.C
coupledTemperature/coupledTemperatureFvPatchScalarField.C
LIB = $(FOAM_LIBBIN)/libcoupledThermophysicalTransportModels

View File

@ -0,0 +1,19 @@
EXE_INC = \
-I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \
-I$(LIB_SRC)/ThermophysicalTransportModels/solidThermophysicalTransportModels/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
-I$(LIB_SRC)/physicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
LIB_LIBS = \
-lfluidThermophysicalModels \
-lsolidThermo \
-lthermophysicalTransportModels \
-lmomentumTransportModels \
-lsolidThermophysicalTransportModels \
-lfiniteVolume \
-lmeshTools

View File

@ -24,10 +24,11 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "coupledTemperatureFvPatchScalarField.H" #include "coupledTemperatureFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H" #include "patchKappa.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "fvPatchFieldMapper.H"
#include "mappedPatchBase.H" #include "mappedPatchBase.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -39,7 +40,6 @@ coupledTemperatureFvPatchScalarField
) )
: :
mixedFvPatchScalarField(p, iF), mixedFvPatchScalarField(p, iF),
temperatureCoupledBase(patch()),
TnbrName_("undefined-Tnbr"), TnbrName_("undefined-Tnbr"),
qrNbrName_("undefined-qrNbr"), qrNbrName_("undefined-qrNbr"),
qrName_("undefined-qr"), qrName_("undefined-qr"),
@ -63,7 +63,6 @@ coupledTemperatureFvPatchScalarField
) )
: :
mixedFvPatchScalarField(p, iF), mixedFvPatchScalarField(p, iF),
temperatureCoupledBase(patch(), dict),
TnbrName_(dict.lookupOrDefault<word>("Tnbr", "T")), TnbrName_(dict.lookupOrDefault<word>("Tnbr", "T")),
qrNbrName_(dict.lookupOrDefault<word>("qrNbr", "none")), qrNbrName_(dict.lookupOrDefault<word>("qrNbr", "none")),
qrName_(dict.lookupOrDefault<word>("qr", "none")), qrName_(dict.lookupOrDefault<word>("qr", "none")),
@ -147,7 +146,6 @@ coupledTemperatureFvPatchScalarField
) )
: :
mixedFvPatchScalarField(psf, p, iF, mapper), mixedFvPatchScalarField(psf, p, iF, mapper),
temperatureCoupledBase(patch(), psf),
TnbrName_(psf.TnbrName_), TnbrName_(psf.TnbrName_),
qrNbrName_(psf.qrNbrName_), qrNbrName_(psf.qrNbrName_),
qrName_(psf.qrName_), qrName_(psf.qrName_),
@ -166,7 +164,6 @@ coupledTemperatureFvPatchScalarField
) )
: :
mixedFvPatchScalarField(psf, iF), mixedFvPatchScalarField(psf, iF),
temperatureCoupledBase(patch(), psf),
TnbrName_(psf.TnbrName_), TnbrName_(psf.TnbrName_),
qrNbrName_(psf.qrNbrName_), qrNbrName_(psf.qrNbrName_),
qrName_(psf.qrName_), qrName_(psf.qrName_),
@ -225,12 +222,14 @@ void Foam::coupledTemperatureFvPatchScalarField::updateCoeffs()
: mpp.distribute(coupledTemperatureNbr) : mpp.distribute(coupledTemperatureNbr)
); );
const scalarField KDelta(kappa(*this)*patch().deltaCoeffs()); const scalarField kappa(patchKappa(patch()).kappa());
const scalarField KDelta(kappa*patch().deltaCoeffs());
const scalarField KDeltaNbr const scalarField KDeltaNbr
( (
contactRes_ == 0 contactRes_ == 0
? mpp.distribute(coupledTemperatureNbr.kappa(coupledTemperatureNbr) ? mpp.distribute(patchKappa(patchNbr).kappa()
*patchNbr.deltaCoeffs()) *patchNbr.deltaCoeffs())
: tmp<scalarField>(new scalarField(size(), contactRes_)) : tmp<scalarField>(new scalarField(size(), contactRes_))
); );
@ -272,13 +271,13 @@ void Foam::coupledTemperatureFvPatchScalarField::updateCoeffs()
this->valueFraction() = KDeltaNbr/(KDeltaNbr + KDelta); this->valueFraction() = KDeltaNbr/(KDeltaNbr + KDelta);
this->refValue() = TcNbr; this->refValue() = TcNbr;
this->refGrad() = (qs_ + qr + qrNbr)/kappa(*this); this->refGrad() = (qs_ + qr + qrNbr)/kappa;
mixedFvPatchScalarField::updateCoeffs(); mixedFvPatchScalarField::updateCoeffs();
if (debug) if (debug)
{ {
scalar Q = gSum(kappa(*this)*patch().magSf()*snGrad()); scalar Q = gSum(kappa*patch().magSf()*snGrad());
Info<< patch().boundaryMesh().mesh().name() << ':' Info<< patch().boundaryMesh().mesh().name() << ':'
<< patch().name() << ':' << patch().name() << ':'
@ -310,8 +309,6 @@ void Foam::coupledTemperatureFvPatchScalarField::write
writeEntry(os, "qr", qrName_); writeEntry(os, "qr", qrName_);
writeEntry(os, "thicknessLayers", thicknessLayers_); writeEntry(os, "thicknessLayers", thicknessLayers_);
writeEntry(os, "kappaLayers", kappaLayers_); writeEntry(os, "kappaLayers", kappaLayers_);
temperatureCoupledBase::write(os);
} }

View File

@ -39,7 +39,7 @@ Description
and qs is the optional source heat flux. and qs is the optional source heat flux.
The thermal conductivity \c kappa can either be retrieved from various The thermal conductivity \c kappa can either be retrieved from various
possible sources, as detailed in the class temperatureCoupledBase. possible sources, as detailed in the class patchKappa.
Usage Usage
\table \table
@ -72,7 +72,7 @@ Usage
should be specified, not both. should be specified, not both.
See also See also
Foam::temperatureCoupledBase Foam::patchKappa
SourceFiles SourceFiles
coupledTemperatureFvPatchScalarField.C coupledTemperatureFvPatchScalarField.C
@ -83,7 +83,6 @@ SourceFiles
#define coupledTemperatureFvPatchScalarField_H #define coupledTemperatureFvPatchScalarField_H
#include "mixedFvPatchFields.H" #include "mixedFvPatchFields.H"
#include "temperatureCoupledBase.H"
#include "scalarField.H" #include "scalarField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -97,8 +96,7 @@ namespace Foam
class coupledTemperatureFvPatchScalarField class coupledTemperatureFvPatchScalarField
: :
public mixedFvPatchScalarField, public mixedFvPatchScalarField
public temperatureCoupledBase
{ {
// Private Data // Private Data

View File

@ -24,13 +24,13 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "externalTemperatureFvPatchScalarField.H" #include "externalTemperatureFvPatchScalarField.H"
#include "patchKappa.H"
#include "volFields.H" #include "volFields.H"
#include "physicoChemicalConstants.H" #include "physicoChemicalConstants.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
using Foam::constant::physicoChemical::sigma; using Foam::constant::physicoChemical::sigma;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::externalTemperatureFvPatchScalarField:: Foam::externalTemperatureFvPatchScalarField::
@ -41,7 +41,6 @@ externalTemperatureFvPatchScalarField
) )
: :
mixedFvPatchScalarField(p, iF), mixedFvPatchScalarField(p, iF),
temperatureCoupledBase(patch()),
haveQ_(false), haveQ_(false),
Q_(NaN), Q_(NaN),
haveq_(false), haveq_(false),
@ -72,7 +71,6 @@ externalTemperatureFvPatchScalarField
) )
: :
mixedFvPatchScalarField(p, iF), mixedFvPatchScalarField(p, iF),
temperatureCoupledBase(patch(), dict),
haveQ_(dict.found("Q")), haveQ_(dict.found("Q")),
Q_(haveQ_ ? dict.lookup<scalar>("Q") : NaN), Q_(haveQ_ ? dict.lookup<scalar>("Q") : NaN),
haveq_(dict.found("q")), haveq_(dict.found("q")),
@ -146,7 +144,6 @@ externalTemperatureFvPatchScalarField
) )
: :
mixedFvPatchScalarField(ptf, p, iF, mapper), mixedFvPatchScalarField(ptf, p, iF, mapper),
temperatureCoupledBase(patch(), ptf),
haveQ_(ptf.haveQ_), haveQ_(ptf.haveQ_),
Q_(ptf.Q_), Q_(ptf.Q_),
haveq_(ptf.haveq_), haveq_(ptf.haveq_),
@ -177,7 +174,6 @@ externalTemperatureFvPatchScalarField
) )
: :
mixedFvPatchScalarField(tppsf, iF), mixedFvPatchScalarField(tppsf, iF),
temperatureCoupledBase(patch(), tppsf),
haveQ_(tppsf.haveQ_), haveQ_(tppsf.haveQ_),
Q_(tppsf.Q_), Q_(tppsf.Q_),
haveq_(tppsf.haveq_), haveq_(tppsf.haveq_),
@ -311,10 +307,12 @@ void Foam::externalTemperatureFvPatchScalarField::updateCoeffs()
qTot += q_; qTot += q_;
} }
const scalarField kappa(patchKappa(patch()).kappa());
// Evaluate // Evaluate
if (!haveh_) if (!haveh_)
{ {
refGrad() = qTot/kappa(*this); refGrad() = qTot/kappa;
refValue() = Tp; refValue() = Tp;
valueFraction() = 0; valueFraction() = 0;
} }
@ -356,7 +354,7 @@ void Foam::externalTemperatureFvPatchScalarField::updateCoeffs()
const scalarField kappaDeltaCoeffs const scalarField kappaDeltaCoeffs
( (
this->kappa(*this)*patch().deltaCoeffs() kappa*patch().deltaCoeffs()
); );
refGrad() = 0; refGrad() = 0;
@ -386,7 +384,7 @@ void Foam::externalTemperatureFvPatchScalarField::updateCoeffs()
if (debug) if (debug)
{ {
const scalar Q = gSum(kappa(*this)*patch().magSf()*snGrad()); const scalar Q = gSum(kappa*patch().magSf()*snGrad());
Info<< patch().boundaryMesh().mesh().name() << ':' Info<< patch().boundaryMesh().mesh().name() << ':'
<< patch().name() << ':' << patch().name() << ':'
@ -408,8 +406,6 @@ void Foam::externalTemperatureFvPatchScalarField::write
{ {
fvPatchScalarField::write(os); fvPatchScalarField::write(os);
temperatureCoupledBase::write(os);
if (haveQ_) if (haveQ_)
{ {
writeEntry(os, "Q", Q_); writeEntry(os, "Q", Q_);

View File

@ -46,8 +46,9 @@ Description
resistances can be specified through thicknessLayers and kappaLayers resistances can be specified through thicknessLayers and kappaLayers
entries. entries.
The thermal conductivity \c kappa can either be retrieved from various The patch thermal conductivity \c kappa is obtained from the
possible sources, as detailed in the class temperatureCoupledBase. Foam::patchKappa base class so that this boundary condition can be applied
directly to either fluid or solid regions.
The ambient temperature Ta is specified as a Foam::Function1 of time but The ambient temperature Ta is specified as a Foam::Function1 of time but
uniform is space. uniform is space.
@ -83,7 +84,7 @@ Usage
\endverbatim \endverbatim
See also See also
Foam::temperatureCoupledBase Foam::patchKappa
Foam::mixedFvPatchScalarField Foam::mixedFvPatchScalarField
SourceFiles SourceFiles
@ -95,7 +96,6 @@ SourceFiles
#define externalTemperatureFvPatchScalarField_H #define externalTemperatureFvPatchScalarField_H
#include "mixedFvPatchFields.H" #include "mixedFvPatchFields.H"
#include "temperatureCoupledBase.H"
#include "Function1.H" #include "Function1.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -109,8 +109,7 @@ namespace Foam
class externalTemperatureFvPatchScalarField class externalTemperatureFvPatchScalarField
: :
public mixedFvPatchScalarField, public mixedFvPatchScalarField
public temperatureCoupledBase
{ {
// Private Data // Private Data

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -23,37 +23,13 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "temperatureCoupledBase.H" #include "patchKappa.H"
#include "fluidThermo.H"
#include "solidThermo.H"
#include "thermophysicalTransportModel.H" #include "thermophysicalTransportModel.H"
#include "solidThermophysicalTransportModel.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::temperatureCoupledBase::temperatureCoupledBase Foam::patchKappa::patchKappa(const fvPatch& patch)
(
const fvPatch& patch
)
:
patch_(patch)
{}
Foam::temperatureCoupledBase::temperatureCoupledBase
(
const fvPatch& patch,
const dictionary& dict
)
:
patch_(patch)
{}
Foam::temperatureCoupledBase::temperatureCoupledBase
(
const fvPatch& patch,
const temperatureCoupledBase& base
)
: :
patch_(patch) patch_(patch)
{} {}
@ -61,53 +37,58 @@ Foam::temperatureCoupledBase::temperatureCoupledBase
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa Foam::tmp<Foam::scalarField> Foam::patchKappa::kappa() const
(
const fvPatchScalarField& Tp
) const
{ {
const fvMesh& mesh = patch_.boundaryMesh().mesh(); const fvMesh& mesh = patch_.boundaryMesh().mesh();
const label patchi = patch_.index(); const label patchi = patch_.index();
const word& phase(Tp.internalField().group()); if
const word ttmName
( (
IOobject::groupName mesh.foundObject<thermophysicalTransportModel>
( (
thermophysicalTransportModel::typeName, thermophysicalTransportModel::typeName
phase )
) )
);
if (mesh.foundObject<thermophysicalTransportModel>(ttmName))
{ {
const thermophysicalTransportModel& ttm = const thermophysicalTransportModel& ttm =
mesh.lookupObject<thermophysicalTransportModel>(ttmName); mesh.lookupObject<thermophysicalTransportModel>
(
thermophysicalTransportModel::typeName
);
return ttm.kappaEff(patchi); return ttm.kappaEff(patchi);
} }
else if (mesh.foundObject<solidThermo>(physicalProperties::typeName)) else if
(
mesh.foundObject<solidThermophysicalTransportModel>
(
solidThermophysicalTransportModel::typeName
)
)
{ {
const solidThermo& thermo = const solidThermophysicalTransportModel& sttm =
mesh.lookupObject<solidThermo>(physicalProperties::typeName); mesh.lookupObject<solidThermophysicalTransportModel>
(
solidThermophysicalTransportModel::typeName
);
if (!thermo.isotropic()) if (!sttm.thermo().isotropic())
{ {
const symmTensorField kappa(thermo.KappaLocal(patchi)); const symmTensorField kappa(sttm.Kappa(patchi));
const vectorField n(patch_.nf()); const vectorField n(patch_.nf());
return n & kappa & n; return n & kappa & n;
} }
else else
{ {
return thermo.kappa().boundaryField()[patchi]; return sttm.kappa(patchi);
} }
} }
else else
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Cannot find a fluidThermo or solidThermo instance" << "Cannot find a thermophysicalTransportModel "
"or solidThermophysicalTransportModel instance"
<< exit(FatalError); << exit(FatalError);
return scalarField::null(); return scalarField::null();
@ -115,8 +96,4 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
} }
void Foam::temperatureCoupledBase::write(Ostream& os) const
{}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,36 +22,24 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::temperatureCoupledBase Foam::patchKappa
Description Description
Common functions used in temperature coupled boundaries. Provides the patch thermal conductivity \c kappa for the fluid or solid
region an appropriate.
The thermal conductivity \c kappa is obtained from the region fluidThermo For fluid regions \c kappaEff is obtained from the
or solidThermo as appropriate. Foam::thermophysicalTransportModel and for solid regions
\c kappa is obtained from the Foam::solidThermophysicalTransportModel.
For turbulent fluid regions \c kappa is obtained from the
thermophysicalTransportModel \c kappaEff.
For solid regions kappa may be obtained from the anisotropic alpha field
by specifying the optional \c alphaAni field name.
\par Keywords provided by this class:
\table
Property | Description | Required | Default value
alphaAni | Name of the non-isotropic alpha | no |
\endtable
SourceFiles SourceFiles
temperatureCoupledBase.C patchKappa.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef temperatureCoupledBase_H #ifndef patchKappa_H
#define temperatureCoupledBase_H #define patchKappa_H
#include "scalarField.H"
#include "NamedEnum.H"
#include "fvPatch.H" #include "fvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -60,14 +48,14 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class temperatureCoupledBase Declaration Class patchKappa Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class temperatureCoupledBase class patchKappa
{ {
// Private data // Private data
//- Underlying patch //- Reference to the region patch
const fvPatch& patch_; const fvPatch& patch_;
@ -76,33 +64,16 @@ public:
// Constructors // Constructors
//- Construct from patch //- Construct from patch
temperatureCoupledBase patchKappa
( (
const fvPatch& patch const fvPatch& patch
); );
//- Construct from patch and dictionary
temperatureCoupledBase
(
const fvPatch& patch,
const dictionary& dict
);
//- Construct from patch and temperatureCoupledBase
temperatureCoupledBase
(
const fvPatch& patch,
const temperatureCoupledBase& base
);
// Member Functions // Member Functions
//- Given patch temperature calculate corresponding K field //- Thermal conductivity for patch [W/m/K]
tmp<scalarField> kappa(const fvPatchScalarField& Tp) const; tmp<scalarField> kappa() const;
//- Write
void write(Ostream&) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -51,6 +51,8 @@ FickianFourier
{ {
read(); read();
this->correct(); this->correct();
this->printCoeffs(typeName);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -51,6 +51,8 @@ MaxwellStefanFourier
{ {
read(); read();
this->correct(); this->correct();
this->printCoeffs(typeName);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -32,9 +32,7 @@ template<class BasicThermophysicalTransportModel>
void Foam::laminarThermophysicalTransportModel void Foam::laminarThermophysicalTransportModel
< <
BasicThermophysicalTransportModel BasicThermophysicalTransportModel
>::printCoeffs >::printCoeffs(const word& type)
(
const word& type)
{ {
if (printCoeffs_) if (printCoeffs_)
{ {

View File

@ -146,7 +146,7 @@ public:
return coeffDict_; return coeffDict_;
} }
//- Effective thermal turbulent diffusivity for temperature //- Effective thermal turbulent conductivity
// of mixture [W/m/K] // of mixture [W/m/K]
virtual tmp<volScalarField> kappaEff() const virtual tmp<volScalarField> kappaEff() const
{ {
@ -157,7 +157,7 @@ public:
); );
} }
//- Effective thermal turbulent diffusivity for temperature //- Effective thermal turbulent conductivity
// of mixture for patch [W/m/K] // of mixture for patch [W/m/K]
virtual tmp<scalarField> kappaEff(const label patchi) const virtual tmp<scalarField> kappaEff(const label patchi) const
{ {

View File

@ -0,0 +1,5 @@
solidThermophysicalTransportModel/solidThermophysicalTransportModel.C
isotropic/isotropic.C
anisotropic/anisotropic.C
LIB = $(FOAM_LIBBIN)/libsolidThermophysicalTransportModels

View File

@ -0,0 +1,13 @@
EXE_INC = \
-I$(LIB_SRC)/physicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
LIB_LIBS = \
-lsolidThermo \
-lspecie \
-lfiniteVolume \
-lmeshTools

View File

@ -0,0 +1,342 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "anisotropic.H"
#include "fvmLaplacian.H"
#include "fvcLaplacian.H"
#include "fvcSnGrad.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace solidThermophysicalTransportModels
{
defineTypeNameAndDebug(anisotropic, 0);
addToRunTimeSelectionTable
(
solidThermophysicalTransportModel,
anisotropic,
dictionary
);
}
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::solidThermophysicalTransportModels::anisotropic::
setZonesPatchFaces() const
{
// Find all the patch faces adjacent to zones
const fvMesh& mesh = thermo().mesh();
const fvBoundaryMesh& patches = mesh.boundary();
const labelList& own = mesh.faceOwner();
zonesPatchFaces_.setSize(zoneCoordinateSystems_.size());
label zonei = 0;
forAllConstIter
(
PtrDictionary<coordinateSystem>,
zoneCoordinateSystems_,
iter
)
{
zonesPatchFaces_[zonei].setSize(patches.size());
const labelList& zoneCells = mesh.cellZones()[iter().name()];
// Cell in zone
boolList cellInZone(mesh.nCells(), false);
forAll(zoneCells, i)
{
cellInZone[zoneCells[i]] = true;
}
forAll(patches, patchi)
{
const fvPatch& pp = patches[patchi];
zonesPatchFaces_[zonei][patchi].setSize(pp.size());
label nZonePatchFaces = 0;
forAll(pp, patchFacei)
{
const label facei = pp.start() + patchFacei;
if (cellInZone[own[facei]])
{
zonesPatchFaces_[zonei][patchi][nZonePatchFaces++] =
patchFacei;
}
}
zonesPatchFaces_[zonei][patchi].setSize(nZonePatchFaces);
}
zonei++;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::solidThermophysicalTransportModels::anisotropic::anisotropic
(
const solidThermo& thermo
)
:
solidThermophysicalTransportModel(typeName, thermo),
coordinateSystem_(coordinateSystem::New(thermo.mesh(), coeffDict()))
{
if (coeffDict().found("zones"))
{
const dictionary& zonesDict(coeffDict().subDict("zones"));
Info<< " Reading coordinate system for zones:" << endl;
forAllConstIter(dictionary, zonesDict, iter)
{
if (iter().isDict())
{
const word& name = iter().keyword();
const dictionary& dict = iter().dict();
Info<< " " << name << endl;
zoneCoordinateSystems_.insert
(
name,
coordinateSystem::New(name, dict).ptr()
);
}
}
// Find all the patch faces adjacent to zones
setZonesPatchFaces();
Info << endl;
}
this->printCoeffs(typeName);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::solidThermophysicalTransportModels::anisotropic::read()
{
return true;
}
Foam::tmp<Foam::volSymmTensorField>
Foam::solidThermophysicalTransportModels::anisotropic::Kappa() const
{
const solidThermo& thermo = this->thermo();
const fvMesh& mesh = thermo.mesh();
if (zoneCoordinateSystems_.size() && mesh.topoChanged())
{
setZonesPatchFaces();
}
const tmp<volVectorField> tmaterialKappa(thermo.Kappa());
const volVectorField& materialKappa = tmaterialKappa();
tmp<volSymmTensorField> tKappa
(
volSymmTensorField::New
(
"Kappa",
mesh,
dimensionedSymmTensor(materialKappa.dimensions(), Zero)
)
);
volSymmTensorField& Kappa = tKappa.ref();
Kappa.primitiveFieldRef() =
coordinateSystem_.R(mesh.C()).transformDiagTensor(materialKappa);
forAll(Kappa.boundaryField(), patchi)
{
Kappa.boundaryFieldRef()[patchi] =
coordinateSystem_.R(mesh.boundary()[patchi].Cf())
.transformDiagTensor(materialKappa.boundaryField()[patchi]);
}
label zonei = 0;
forAllConstIter
(
PtrDictionary<coordinateSystem>,
zoneCoordinateSystems_,
iter
)
{
const labelList& zoneCells = mesh.cellZones()[iter().name()];
const coordinateSystem& cs = iter();
forAll(zoneCells, i)
{
const label celli = zoneCells[i];
Kappa[celli] =
cs.R().transformDiagTensor
(
mesh.C()[celli],
materialKappa[celli]
);
}
forAll(zonesPatchFaces_[zonei], patchi)
{
symmTensorField& KappaPf = Kappa.boundaryFieldRef()[patchi];
const vectorField& materialKappaPf =
materialKappa.boundaryField()[patchi];
const vectorField& CPf = mesh.boundary()[patchi].Cf();
forAll(zonesPatchFaces_[zonei][patchi], zonePatchFacei)
{
const label patchFacei =
zonesPatchFaces_[zonei][patchi][zonePatchFacei];
KappaPf[patchFacei] =
cs.R().transformDiagTensor
(
CPf[patchFacei],
materialKappaPf[patchFacei]
);
}
}
zonei++;
}
return tKappa;
}
Foam::tmp<Foam::symmTensorField>
Foam::solidThermophysicalTransportModels::anisotropic::Kappa
(
const label patchi
) const
{
const solidThermo& thermo = this->thermo();
const vectorField& CPf = thermo.mesh().boundary()[patchi].Cf();
const vectorField materialKappaPf(thermo.Kappa(patchi));
tmp<symmTensorField> tKappa
(
coordinateSystem_.R(CPf).transformDiagTensor(materialKappaPf)
);
symmTensorField& KappaPf = tKappa.ref();
label zonei = 0;
forAllConstIter
(
PtrDictionary<coordinateSystem>,
zoneCoordinateSystems_,
iter
)
{
const coordinateSystem& cs = iter();
forAll(zonesPatchFaces_[zonei][patchi], zonePatchFacei)
{
const label patchFacei =
zonesPatchFaces_[zonei][patchi][zonePatchFacei];
KappaPf[patchFacei] =
cs.R().transformDiagTensor
(
CPf[patchFacei],
materialKappaPf[patchFacei]
);
}
zonei++;
}
return tKappa;
}
Foam::tmp<Foam::surfaceScalarField>
Foam::solidThermophysicalTransportModels::anisotropic::q() const
{
const solidThermo& thermo = this->thermo();
const fvMesh& mesh = thermo.mesh();
return surfaceScalarField::New
(
"q",
-fvm::laplacian(Kappa(), thermo.T())().flux()/mesh.magSf()
);
}
Foam::tmp<Foam::fvScalarMatrix>
Foam::solidThermophysicalTransportModels::anisotropic::divq
(
volScalarField& e
) const
{
const solidThermo& thermo = this->thermo();
const volSymmTensorField Kappa(this->Kappa());
// Return heat flux source as an implicit energy correction
// to the temperature gradient flux
return
-fvc::laplacian(Kappa, thermo.T())
-correction
(
fvm::laplacian
(
Kappa/thermo.Cv(),
e,
"laplacian(alphae,e)"
)
);
}
void Foam::solidThermophysicalTransportModels::anisotropic::correct()
{
solidThermophysicalTransportModel::correct();
}
// ************************************************************************* //

View File

@ -0,0 +1,172 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 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 <http://www.gnu.org/licenses/>.
Class
Foam::solidThermophysicalTransportModels::anisotropic
Description
Solid thermophysical transport model for anisotropic thermal conductivity
The anisotropic thermal conductivity field is evaluated from the solid
material anisotropic kappa specified in the physicalProperties dictionary
transformed into the global coordinate system using default
coordinate system and optionally additional coordinate systems specified
per-zone in the thermophysicalProperties dictionary.
Usage
Example of the anisotropic thermal conductivity specification in
thermophysicalProperties with two zone-based coordinate systems in
addition to the default:
\verbatim
model anisotropic;
// Default coordinate system
coordinateSystem
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type cylindrical;
e3 (1 0 0);
}
}
// Optional zone coordinate systems
zones
{
coil1
{
type cartesian;
origin (0.1 0.2 0.7);
coordinateRotation
{
type cylindrical;
e3 (0.5 0.866 0);
}
}
coil2
{
type cartesian;
origin (0.4 0.5 1);
coordinateRotation
{
type cylindrical;
e3 (0.866 0.5 0);
}
}
}
\endverbatim
SourceFiles
anisotropic.C
\*---------------------------------------------------------------------------*/
#ifndef anisotropic_H
#define anisotropic_H
#include "solidThermophysicalTransportModel.H"
#include "coordinateSystem.H"
#include "PtrDictionary.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace solidThermophysicalTransportModels
{
/*---------------------------------------------------------------------------*\
Class anisotropic Declaration
\*---------------------------------------------------------------------------*/
class anisotropic
:
public solidThermophysicalTransportModel
{
// Private member data
coordinateSystem coordinateSystem_;
//- Optional zone coordinate systems
PtrDictionary<coordinateSystem> zoneCoordinateSystems_;
// List of patch faces adjacent to coordinate zones
mutable labelListListList zonesPatchFaces_;
//- Find all the patch faces adjacent to zones
void setZonesPatchFaces() const;
public:
//- Runtime type information
TypeName("anisotropic");
// Constructors
//- Construct from solid thermophysical properties
anisotropic(const solidThermo& thermo);
//- Destructor
virtual ~anisotropic()
{}
// Member Functions
//- Read thermophysicalTransport dictionary
virtual bool read();
//- Thermal conductivity [W/m/K]
virtual tmp<volSymmTensorField> Kappa() const;
//- Thermal conductivity for patch [W/m/K]
virtual tmp<symmTensorField> Kappa(const label patchi) const;
//- Return the heat flux [W/m^2]
virtual tmp<surfaceScalarField> q() const;
//- Return the source term for the energy equation
virtual tmp<fvScalarMatrix> divq(volScalarField& he) const;
//- Correct the anisotropic viscosity
virtual void correct();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace solidThermophysicalTransportModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,135 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "isotropic.H"
#include "fvmLaplacian.H"
#include "fvcLaplacian.H"
#include "fvcSnGrad.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace solidThermophysicalTransportModels
{
defineTypeNameAndDebug(isotropic, 0);
addToRunTimeSelectionTable
(
solidThermophysicalTransportModel,
isotropic,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::solidThermophysicalTransportModels::isotropic::isotropic
(
const solidThermo& thermo
)
:
solidThermophysicalTransportModel(typeName, thermo)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::dictionary&
Foam::solidThermophysicalTransportModels::isotropic::coeffDict() const
{
return dictionary::null;
}
bool Foam::solidThermophysicalTransportModels::isotropic::read()
{
return true;
}
Foam::tmp<Foam::volSymmTensorField>
Foam::solidThermophysicalTransportModels::isotropic::Kappa() const
{
NotImplemented;
return volSymmTensorField::null();
}
Foam::tmp<Foam::symmTensorField>
Foam::solidThermophysicalTransportModels::isotropic::Kappa
(
const label patchi
) const
{
NotImplemented;
return symmTensorField::null();
}
Foam::tmp<Foam::surfaceScalarField>
Foam::solidThermophysicalTransportModels::isotropic::q() const
{
return surfaceScalarField::New
(
"q",
-fvc::interpolate(kappa())*fvc::snGrad(thermo().T())
);
}
Foam::tmp<Foam::fvScalarMatrix>
Foam::solidThermophysicalTransportModels::isotropic::divq
(
volScalarField& e
) const
{
const solidThermo& thermo = this->thermo();
// Return heat flux source as an implicit energy correction
// to the temperature gradient flux
return
-fvc::laplacian(kappa(), thermo.T())
-correction
(
fvm::laplacian
(
kappa()/thermo.Cv(),
e,
"laplacian(alphae,e)"
)
);
}
void Foam::solidThermophysicalTransportModels::isotropic::correct()
{
solidThermophysicalTransportModel::correct();
}
// ************************************************************************* //

View File

@ -0,0 +1,111 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 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 <http://www.gnu.org/licenses/>.
Class
Foam::solidThermophysicalTransportModels::isotropic
Description
Solid thermophysical transport model for isotropic thermal conductivity
This is the default transport model for solids and selected automatically if
the thermophysicalTransport dictionary is not present in the constant or
region directory.
SourceFiles
isotropic.C
\*---------------------------------------------------------------------------*/
#ifndef isotropic_H
#define isotropic_H
#include "solidThermophysicalTransportModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace solidThermophysicalTransportModels
{
/*---------------------------------------------------------------------------*\
Class isotropic Declaration
\*---------------------------------------------------------------------------*/
class isotropic
:
public solidThermophysicalTransportModel
{
public:
//- Runtime type information
TypeName("isotropic");
// Constructors
//- Construct from solid thermophysical properties
isotropic(const solidThermo& thermo);
//- Destructor
virtual ~isotropic()
{}
// Member Functions
//- Const access to the coefficients dictionary
virtual const dictionary& coeffDict() const;
//- Read thermophysicalTransport dictionary
virtual bool read();
//- Thermal conductivity [W/m/K]
virtual tmp<volSymmTensorField> Kappa() const;
//- Thermal conductivity for patch [W/m/K]
virtual tmp<symmTensorField> Kappa(const label patchi) const;
//- Return the heat flux [W/m^2]
virtual tmp<surfaceScalarField> q() const;
//- Return the source term for the energy equation
virtual tmp<fvScalarMatrix> divq(volScalarField& he) const;
//- Correct the isotropic viscosity
virtual void correct();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace solidThermophysicalTransportModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,172 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "solidThermophysicalTransportModel.H"
#include "isotropic.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(solidThermophysicalTransportModel, 0);
defineRunTimeSelectionTable(solidThermophysicalTransportModel, dictionary);
}
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
void Foam::solidThermophysicalTransportModel::printCoeffs
(const word& type)
{
if (printCoeffs_)
{
Info<< coeffDict_.dictName() << coeffDict_ << endl;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::solidThermophysicalTransportModel::solidThermophysicalTransportModel
(
const word& type,
const solidThermo& thermo
)
:
IOdictionary
(
IOobject
(
typeName,
thermo.mesh().time().constant(),
thermo.mesh(),
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
)
),
thermo_(thermo),
printCoeffs_(lookupOrDefault<Switch>("printCoeffs", false)),
coeffDict_(optionalSubDict(type + "Coeffs"))
{
// Add run-time re-reading of thermophysicalTransport dictionary
// after construction to avoid problems if the dictionary is not present
readOpt() = IOobject::MUST_READ_IF_MODIFIED;
addWatch();
}
// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::solidThermophysicalTransportModel>
Foam::solidThermophysicalTransportModel::New(const solidThermo& thermo)
{
typeIOobject<IOdictionary> header
(
solidThermophysicalTransportModel::typeName,
thermo.mesh().time().constant(),
thermo.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
);
if (header.headerOk())
{
const word modelType(IOdictionary(header).lookup("model"));
Info<< "Selecting solid thermophysical transport model "
<< modelType << endl;
typename dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorInFunction
<< "Unknown solid thermophysical transport model "
<< modelType << nl << nl
<< "Available models:" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<solidThermophysicalTransportModel>
(
cstrIter()(thermo)
);
}
else
{
Info<< "Selecting default solid thermophysical transport model "
<< solidThermophysicalTransportModels::isotropic::typeName
<< endl;
return autoPtr<solidThermophysicalTransportModel>
(
new solidThermophysicalTransportModels::isotropic(thermo)
);
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::solidThermophysicalTransportModel::kappa() const
{
return thermo().kappa();
}
Foam::tmp<Foam::scalarField>
Foam::solidThermophysicalTransportModel::kappa
(
const label patchi
) const
{
return thermo().kappa().boundaryField()[patchi];
}
bool Foam::solidThermophysicalTransportModel::read()
{
if (regIOobject::read())
{
coeffDict_ <<= optionalSubDict(type() + "Coeffs");
return true;
}
else
{
return false;
}
}
void Foam::solidThermophysicalTransportModel::correct()
{}
// ************************************************************************* //

View File

@ -0,0 +1,179 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 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 <http://www.gnu.org/licenses/>.
Class
Foam::solidThermophysicalTransportModel
Description
Abstract base class for thermophysical transport models
(RAS, LES and laminar).
SourceFiles
solidThermophysicalTransportModel.C
\*---------------------------------------------------------------------------*/
#ifndef solidThermophysicalTransportModel_H
#define solidThermophysicalTransportModel_H
#include "solidThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class solidThermophysicalTransportModel Declaration
\*---------------------------------------------------------------------------*/
class solidThermophysicalTransportModel
:
public IOdictionary
{
protected:
// Protected data
//- Reference to the solid thermophysical properties
const solidThermo& thermo_;
//- Flag to print the model coeffs at run-time
Switch printCoeffs_;
//- Model coefficients dictionary
dictionary coeffDict_;
// Protected Member Functions
//- Print model coefficients
virtual void printCoeffs(const word& type);
public:
//- Runtime type information
TypeName("thermophysicalTransport");
// Declare run-time constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
solidThermophysicalTransportModel,
dictionary,
(
const solidThermo& thermo
),
(thermo)
);
// Constructors
//- Construct from solid thermophysical properties
solidThermophysicalTransportModel
(
const word& type,
const solidThermo& thermo
);
//- Disallow default bitwise copy construction
solidThermophysicalTransportModel
(
const solidThermophysicalTransportModel&
) = delete;
// Selectors
//- Return a reference to the selected thermophysical transport model
static autoPtr<solidThermophysicalTransportModel> New
(
const solidThermo& thermo
);
//- Destructor
virtual ~solidThermophysicalTransportModel()
{}
// Member Functions
//- Read model coefficients if they have changed
virtual bool read() = 0;
//- Access function to solid thermophysical properties
virtual const solidThermo& thermo() const
{
return thermo_;
}
//- Const access to the coefficients dictionary
virtual const dictionary& coeffDict() const
{
return coeffDict_;
}
//- Thermal conductivity [W/m/K]
virtual tmp<volScalarField> kappa() const;
//- Thermal conductivity for patch [W/m/K]
virtual tmp<scalarField> kappa(const label patchi) const;
//- Thermal conductivity [W/m/K]
virtual tmp<volSymmTensorField> Kappa() const = 0;
//- Thermal conductivity for patch [W/m/K]
virtual tmp<symmTensorField> Kappa(const label patchi) const = 0;
//- Return the heat flux [W/m^2]
virtual tmp<surfaceScalarField> q() const = 0;
//- Return the source term for the energy equation
virtual tmp<fvScalarMatrix> divq(volScalarField& he) const = 0;
//- Solve the thermophysical transport model equations
// and correct the transport coefficients
virtual void correct() = 0;
// Member Operators
//- Disallow default bitwise assignment
void operator=(const solidThermophysicalTransportModel&) = delete;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -90,22 +90,23 @@ public:
//- Read model coefficients if they have changed //- Read model coefficients if they have changed
virtual bool read() = 0; virtual bool read() = 0;
//- Access function to momentum transport model
const compressibleMomentumTransportModel& momentumTransport() const const compressibleMomentumTransportModel& momentumTransport() const
{ {
return momentumTransportModel_; return momentumTransportModel_;
} }
//- Access function to incompressible transport model //- Access function to fluid thermophysical properties
virtual const fluidThermo& thermo() const = 0; virtual const fluidThermo& thermo() const = 0;
//- Const access to the coefficients dictionary //- Const access to the coefficients dictionary
virtual const dictionary& coeffDict() const = 0; virtual const dictionary& coeffDict() const = 0;
//- Effective thermal turbulent diffusivity for temperature //- Effective thermal turbulent conductivity
// of mixture [W/m/K] // of mixture [W/m/K]
virtual tmp<volScalarField> kappaEff() const = 0; virtual tmp<volScalarField> kappaEff() const = 0;
//- Effective thermal turbulent diffusivity for temperature //- Effective thermal turbulent conductivity
// of mixture for patch [W/m/K] // of mixture for patch [W/m/K]
virtual tmp<scalarField> kappaEff(const label patchi) const = 0; virtual tmp<scalarField> kappaEff(const label patchi) const = 0;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -53,6 +53,8 @@ FickianEddyDiffusivity
{ {
read(); read();
this->correct(); this->correct();
this->printCoeffs(typeName);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -146,11 +146,11 @@ public:
return coeffDict_; return coeffDict_;
} }
//- Effective thermal turbulent diffusivity for temperature //- Effective thermal turbulent conductivity
// of mixture [W/m/K] // of mixture [W/m/K]
virtual tmp<volScalarField> kappaEff() const = 0; virtual tmp<volScalarField> kappaEff() const = 0;
//- Effective thermal turbulent diffusivity for temperature //- Effective thermal turbulent conductivity
// of mixture for patch [W/m/K] // of mixture for patch [W/m/K]
virtual tmp<scalarField> kappaEff(const label patchi) const = 0; virtual tmp<scalarField> kappaEff(const label patchi) const = 0;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -146,11 +146,11 @@ public:
return coeffDict_; return coeffDict_;
} }
//- Effective thermal turbulent diffusivity for temperature //- Effective thermal turbulent conductivity
// of mixture [W/m/K] // of mixture [W/m/K]
virtual tmp<volScalarField> kappaEff() const = 0; virtual tmp<volScalarField> kappaEff() const = 0;
//- Effective thermal turbulent diffusivity for temperature //- Effective thermal turbulent conductivity
// of mixture for patch [W/m/K] // of mixture for patch [W/m/K]
virtual tmp<scalarField> kappaEff(const label patchi) const = 0; virtual tmp<scalarField> kappaEff(const label patchi) const = 0;

View File

@ -135,14 +135,14 @@ public:
return alphat()().boundaryField()[patchi]; return alphat()().boundaryField()[patchi];
} }
//- Effective thermal turbulent diffusivity for temperature //- Effective thermal turbulent conductivity
// of mixture [W/m/K] // of mixture [W/m/K]
virtual tmp<volScalarField> kappaEff() const virtual tmp<volScalarField> kappaEff() const
{ {
return this->thermo().kappa() + this->thermo().Cp()*alphat(); return this->thermo().kappa() + this->thermo().Cp()*alphat();
} }
//- Effective thermal turbulent diffusivity for temperature //- Effective thermal turbulent conductivity
// of mixture for patch [W/m/K] // of mixture for patch [W/m/K]
virtual tmp<scalarField> kappaEff(const label patchi) const virtual tmp<scalarField> kappaEff(const label patchi) const
{ {

View File

@ -56,7 +56,9 @@ nonUnityLewisEddyDiffusivity
), ),
Sct_("Sct", dimless, this->coeffDict_) Sct_("Sct", dimless, this->coeffDict_)
{} {
this->printCoeffs(typeName);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -63,7 +63,9 @@ unityLewisEddyDiffusivity
thermo, thermo,
false false
) )
{} {
this->printCoeffs(typeName);
}
template<class TurbulenceThermophysicalTransportModel> template<class TurbulenceThermophysicalTransportModel>
@ -116,7 +118,12 @@ unityLewisEddyDiffusivity
), ),
momentumTransport.mesh() momentumTransport.mesh()
) )
{} {
if (type == typeName)
{
this->printCoeffs(type);
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View File

@ -143,14 +143,14 @@ public:
return alphat()().boundaryField()[patchi]; return alphat()().boundaryField()[patchi];
} }
//- Effective thermal turbulent diffusivity for temperature //- Effective thermal turbulent conductivity
// of mixture [W/m/K] // of mixture [W/m/K]
virtual tmp<volScalarField> kappaEff() const virtual tmp<volScalarField> kappaEff() const
{ {
return this->thermo().kappa() + this->thermo().Cp()*alphat(); return this->thermo().kappa() + this->thermo().Cp()*alphat();
} }
//- Effective thermal turbulent diffusivity for temperature //- Effective thermal turbulent conductivity
// of mixture for patch [W/m/K] // of mixture for patch [W/m/K]
virtual tmp<scalarField> kappaEff(const label patchi) const virtual tmp<scalarField> kappaEff(const label patchi) const
{ {

View File

@ -89,7 +89,7 @@ void Foam::porosityModels::DarcyForchheimer::calcTransformModelData()
D_[zoneI][0].yy() = dXYZ_.value().y(); D_[zoneI][0].yy() = dXYZ_.value().y();
D_[zoneI][0].zz() = dXYZ_.value().z(); D_[zoneI][0].zz() = dXYZ_.value().z();
D_[zoneI][0] = coordSys_.R().transformTensor(D_[zoneI][0]); D_[zoneI][0] = coordSys_.R().transform(Zero, D_[zoneI][0]);
// leading 0.5 is from 1/2*rho // leading 0.5 is from 1/2*rho
F_[zoneI][0] = Zero; F_[zoneI][0] = Zero;
@ -97,7 +97,7 @@ void Foam::porosityModels::DarcyForchheimer::calcTransformModelData()
F_[zoneI][0].yy() = 0.5*fXYZ_.value().y(); F_[zoneI][0].yy() = 0.5*fXYZ_.value().y();
F_[zoneI][0].zz() = 0.5*fXYZ_.value().z(); F_[zoneI][0].zz() = 0.5*fXYZ_.value().z();
F_[zoneI][0] = coordSys_.R().transformTensor(F_[zoneI][0]); F_[zoneI][0] = coordSys_.R().transform(Zero, F_[zoneI][0]);
} }
} }
else else
@ -128,8 +128,8 @@ void Foam::porosityModels::DarcyForchheimer::calcTransformModelData()
UIndirectList<vector>(mesh_.C(), cells)() UIndirectList<vector>(mesh_.C(), cells)()
); );
D_[zoneI] = R.transformTensor(D_[zoneI]); D_[zoneI] = R.transform(D_[zoneI]);
F_[zoneI] = R.transformTensor(F_[zoneI]); F_[zoneI] = R.transform(F_[zoneI]);
} }
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -144,13 +144,13 @@ void Foam::porosityModels::fixedCoeff::calcTransformModelData()
alpha_[zoneI][0].xx() = alphaXYZ_.value().x(); alpha_[zoneI][0].xx() = alphaXYZ_.value().x();
alpha_[zoneI][0].yy() = alphaXYZ_.value().y(); alpha_[zoneI][0].yy() = alphaXYZ_.value().y();
alpha_[zoneI][0].zz() = alphaXYZ_.value().z(); alpha_[zoneI][0].zz() = alphaXYZ_.value().z();
alpha_[zoneI][0] = coordSys_.R().transformTensor(alpha_[zoneI][0]); alpha_[zoneI][0] = coordSys_.R().transform(Zero, alpha_[zoneI][0]);
beta_[zoneI][0] = Zero; beta_[zoneI][0] = Zero;
beta_[zoneI][0].xx() = betaXYZ_.value().x(); beta_[zoneI][0].xx() = betaXYZ_.value().x();
beta_[zoneI][0].yy() = betaXYZ_.value().y(); beta_[zoneI][0].yy() = betaXYZ_.value().y();
beta_[zoneI][0].zz() = betaXYZ_.value().z(); beta_[zoneI][0].zz() = betaXYZ_.value().z();
beta_[zoneI][0] = coordSys_.R().transformTensor(beta_[zoneI][0]); beta_[zoneI][0] = coordSys_.R().transform(Zero, beta_[zoneI][0]);
} }
} }
else else
@ -180,8 +180,8 @@ void Foam::porosityModels::fixedCoeff::calcTransformModelData()
UIndirectList<vector>(mesh_.C(), cells)() UIndirectList<vector>(mesh_.C(), cells)()
); );
alpha_[zoneI] = R.transformTensor(alpha_[zoneI]); alpha_[zoneI] = R.transform(alpha_[zoneI]);
beta_[zoneI] = R.transformTensor(beta_[zoneI]); beta_[zoneI] = R.transform(beta_[zoneI]);
} }
} }
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -26,7 +26,7 @@ Class
Description Description
Calculates and outputs the second largest eigenvalue of the sum of the Calculates and outputs the second largest eigenvalue of the sum of the
square of the symmetrical and anti-symmetrical parts of the velocity square of the symmetric and anti-symmetric parts of the velocity
gradient tensor. gradient tensor.
See also See also

View File

@ -12,7 +12,8 @@ EXE_INC = \
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
-I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \
-I$(LIB_SRC)/ThermophysicalTransportModels/solidThermophysicalTransportModels/lnInclude
LIB_LIBS = \ LIB_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
@ -23,6 +24,7 @@ LIB_LIBS = \
-lincompressibleMomentumTransportModels \ -lincompressibleMomentumTransportModels \
-lcompressibleMomentumTransportModels \ -lcompressibleMomentumTransportModels \
-lthermophysicalTransportModels \ -lthermophysicalTransportModels \
-lsolidThermophysicalTransportModels \
-lmeshTools \ -lmeshTools \
-lsurfMesh \ -lsurfMesh \
-llagrangian \ -llagrangian \

View File

@ -25,6 +25,7 @@ License
#include "wallHeatFlux.H" #include "wallHeatFlux.H"
#include "thermophysicalTransportModel.H" #include "thermophysicalTransportModel.H"
#include "solidThermophysicalTransportModel.H"
#include "solidThermo.H" #include "solidThermo.H"
#include "surfaceInterpolate.H" #include "surfaceInterpolate.H"
#include "fvcGrad.H" #include "fvcGrad.H"
@ -219,12 +220,21 @@ bool Foam::functionObjects::wallHeatFlux::execute()
return store(fieldName, calcWallHeatFlux(ttm.q())); return store(fieldName, calcWallHeatFlux(ttm.q()));
} }
else if (foundObject<solidThermo>(physicalProperties::typeName)) else if
(
foundObject<solidThermophysicalTransportModel>
(
solidThermophysicalTransportModel::typeName
)
)
{ {
const solidThermo& thermo = const solidThermophysicalTransportModel& sttm =
lookupObject<solidThermo>(physicalProperties::typeName); lookupObject<solidThermophysicalTransportModel>
(
solidThermophysicalTransportModel::typeName
);
return store(fieldName, calcWallHeatFlux(thermo.q())); return store(fieldName, calcWallHeatFlux(sttm.q()));
} }
else else
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -125,24 +125,21 @@ Foam::EulerCoordinateRotation::EulerCoordinateRotation
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::vector Foam::EulerCoordinateRotation::transform(const vector& st) const Foam::vector Foam::EulerCoordinateRotation::transform(const vector& v) const
{ {
return (R_ & st); return (R_ & v);
} }
Foam::vector Foam::EulerCoordinateRotation::invTransform Foam::vector Foam::EulerCoordinateRotation::invTransform(const vector& v) const
(
const vector& st
) const
{ {
return (Rtr_ & st); return (Rtr_ & v);
} }
Foam::tmp<Foam::vectorField> Foam::EulerCoordinateRotation::transform Foam::tmp<Foam::vectorField> Foam::EulerCoordinateRotation::transform
( (
const vectorField& st const vectorField& vf
) const ) const
{ {
NotImplemented; NotImplemented;
@ -152,7 +149,7 @@ Foam::tmp<Foam::vectorField> Foam::EulerCoordinateRotation::transform
Foam::tmp<Foam::vectorField> Foam::EulerCoordinateRotation::invTransform Foam::tmp<Foam::vectorField> Foam::EulerCoordinateRotation::invTransform
( (
const vectorField& st const vectorField& vf
) const ) const
{ {
NotImplemented; NotImplemented;
@ -160,9 +157,9 @@ Foam::tmp<Foam::vectorField> Foam::EulerCoordinateRotation::invTransform
} }
Foam::tmp<Foam::tensorField> Foam::EulerCoordinateRotation::transformTensor Foam::tmp<Foam::tensorField> Foam::EulerCoordinateRotation::transform
( (
const tensorField& st const tensorField& volSymmTensorField
) const ) const
{ {
NotImplemented; NotImplemented;
@ -170,38 +167,40 @@ Foam::tmp<Foam::tensorField> Foam::EulerCoordinateRotation::transformTensor
} }
Foam::tensor Foam::EulerCoordinateRotation::transformTensor Foam::tensor Foam::EulerCoordinateRotation::transform
( (
const tensor& st const vector& p,
const tensor& t
) const ) const
{ {
return (R_ & st & Rtr_); return (R_ & t & Rtr_);
} }
Foam::tmp<Foam::symmTensorField> Foam::EulerCoordinateRotation:: Foam::tmp<Foam::symmTensorField> Foam::EulerCoordinateRotation::
transformVector transformDiagTensor
( (
const vectorField& st const vectorField& vf
) const ) const
{ {
tmp<symmTensorField> tfld(new symmTensorField(st.size())); tmp<symmTensorField> tfld(new symmTensorField(vf.size()));
symmTensorField& fld = tfld.ref(); symmTensorField& fld = tfld.ref();
forAll(fld, i) forAll(fld, i)
{ {
fld[i] = transformPrincipal(R_, st[i]); fld[i] = transformVectorDiagTensor(R_, vf[i]);
} }
return tfld; return tfld;
} }
Foam::symmTensor Foam::EulerCoordinateRotation::transformVector Foam::symmTensor Foam::EulerCoordinateRotation::transformDiagTensor
( (
const vector& st const vector& p,
const vector& v
) const ) const
{ {
return transformPrincipal(R_, st); return transformVectorDiagTensor(R_, v);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -145,33 +145,37 @@ public:
} }
//- Transform vectorField using transformation tensor field //- Transform vectorField using transformation tensor field
virtual tmp<vectorField> transform(const vectorField& st) const; virtual tmp<vectorField> transform(const vectorField& vf) const;
//- Transform vector using transformation tensor //- Transform vector using transformation tensor
virtual vector transform(const vector& st) const; virtual vector transform(const vector& v) const;
//- Inverse transform vectorField using transformation tensor field //- Inverse transform vectorField using transformation tensor field
virtual tmp<vectorField> invTransform(const vectorField& st) const; virtual tmp<vectorField> invTransform(const vectorField& vf) const;
//- Inverse transform vector using transformation tensor //- Inverse transform vector using transformation tensor
virtual vector invTransform(const vector& st) const; virtual vector invTransform(const vector& v) const;
//- Transform tensor field using transformation tensorField //- Transform tensor field using transformation tensorField
virtual tmp<tensorField> transformTensor(const tensorField& st) const; virtual tmp<tensorField> transform(const tensorField& tf) const;
//- Transform tensor using transformation tensorField //- Transform tensor using transformation tensorField
virtual tensor transformTensor(const tensor& st) const; virtual tensor transform(const vector& p, const tensor& t) const;
//- Transform vectorField using transformation tensorField and return //- Transform diagTensor masquerading as a vector using transformation
// symmetrical tensorField // tensor and return symmTensor
virtual tmp<symmTensorField> transformVector virtual symmTensor transformDiagTensor
( (
const vectorField& st const vector& p,
const vector& v
) const; ) const;
//- Transform vector using transformation tensor and return //- Transform diagTensorField masquerading as a vectorField
// symmetrical tensor // using transformation tensorField and return symmTensorField
virtual symmTensor transformVector(const vector& st) const; virtual tmp<symmTensorField> transformDiagTensor
(
const vectorField& vf
) const;
// Write // Write

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -125,24 +125,21 @@ Foam::STARCDCoordinateRotation::STARCDCoordinateRotation
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::vector Foam::STARCDCoordinateRotation::transform(const vector& st) const Foam::vector Foam::STARCDCoordinateRotation::transform(const vector& v) const
{ {
return (R_ & st); return (R_ & v);
} }
Foam::vector Foam::STARCDCoordinateRotation::invTransform Foam::vector Foam::STARCDCoordinateRotation::invTransform(const vector& v) const
(
const vector& st
) const
{ {
return (Rtr_ & st); return (Rtr_ & v);
} }
Foam::tmp<Foam::vectorField> Foam::STARCDCoordinateRotation::transform Foam::tmp<Foam::vectorField> Foam::STARCDCoordinateRotation::transform
( (
const vectorField& st const vectorField& vf
) const ) const
{ {
NotImplemented; NotImplemented;
@ -152,7 +149,7 @@ Foam::tmp<Foam::vectorField> Foam::STARCDCoordinateRotation::transform
Foam::tmp<Foam::vectorField> Foam::STARCDCoordinateRotation::invTransform Foam::tmp<Foam::vectorField> Foam::STARCDCoordinateRotation::invTransform
( (
const vectorField& st const vectorField& vf
) const ) const
{ {
NotImplemented; NotImplemented;
@ -160,9 +157,9 @@ Foam::tmp<Foam::vectorField> Foam::STARCDCoordinateRotation::invTransform
} }
Foam::tmp<Foam::tensorField> Foam::STARCDCoordinateRotation::transformTensor Foam::tmp<Foam::tensorField> Foam::STARCDCoordinateRotation::transform
( (
const tensorField& st const tensorField& tf
) const ) const
{ {
NotImplemented; NotImplemented;
@ -170,38 +167,40 @@ Foam::tmp<Foam::tensorField> Foam::STARCDCoordinateRotation::transformTensor
} }
Foam::tensor Foam::STARCDCoordinateRotation::transformTensor Foam::tensor Foam::STARCDCoordinateRotation::transform
( (
const tensor& st const vector& p,
const tensor& t
) const ) const
{ {
return (R_ & st & Rtr_); return (R_ & t & Rtr_);
} }
Foam::tmp<Foam::symmTensorField> Foam::STARCDCoordinateRotation:: Foam::tmp<Foam::symmTensorField> Foam::STARCDCoordinateRotation::
transformVector transformDiagTensor
( (
const vectorField& st const vectorField& vf
) const ) const
{ {
tmp<symmTensorField> tfld(new symmTensorField(st.size())); tmp<symmTensorField> tfld(new symmTensorField(vf.size()));
symmTensorField& fld = tfld.ref(); symmTensorField& fld = tfld.ref();
forAll(fld, i) forAll(fld, i)
{ {
fld[i] = transformPrincipal(R_, st[i]); fld[i] = transformVectorDiagTensor(R_, vf[i]);
} }
return tfld; return tfld;
} }
Foam::symmTensor Foam::STARCDCoordinateRotation::transformVector Foam::symmTensor Foam::STARCDCoordinateRotation::transformDiagTensor
( (
const vector& st const vector& p,
const vector& v
) const ) const
{ {
return transformPrincipal(R_, st); return transformVectorDiagTensor(R_, v);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -146,33 +146,37 @@ public:
} }
//- Transform vectorField using transformation tensor field //- Transform vectorField using transformation tensor field
virtual tmp<vectorField> transform(const vectorField& st) const; virtual tmp<vectorField> transform(const vectorField& vf) const;
//- Transform vector using transformation tensor //- Transform vector using transformation tensor
virtual vector transform(const vector& st) const; virtual vector transform(const vector& v) const;
//- Inverse transform vectorField using transformation tensor field //- Inverse transform vectorField using transformation tensor field
virtual tmp<vectorField> invTransform(const vectorField& st) const; virtual tmp<vectorField> invTransform(const vectorField& vf) const;
//- Inverse transform vector using transformation tensor //- Inverse transform vector using transformation tensor
virtual vector invTransform(const vector& st) const; virtual vector invTransform(const vector& v) const;
//- Transform tensor field using transformation tensorField //- Transform tensor field using transformation tensorField
virtual tmp<tensorField> transformTensor(const tensorField& st) const; virtual tmp<tensorField> transform(const tensorField& tf) const;
//- Transform tensor using transformation tensorField //- Transform tensor using transformation tensorField
virtual tensor transformTensor(const tensor& st) const; virtual tensor transform(const vector& p, const tensor& t) const;
//- Transform vectorField using transformation tensorField and return //- Transform diagTensor masquerading as a vector using transformation
// symmetrical tensorField // tensor and return symmTensor
virtual tmp<symmTensorField> transformVector virtual symmTensor transformDiagTensor
( (
const vectorField& st const vector& p,
const vector& v
) const; ) const;
//- Transform vector using transformation tensor and return //- Transform diagTensorField masquerading as a vectorField
// symmetrical tensor // using transformation tensorField and return symmTensorField
virtual symmTensor transformVector(const vector& st) const; virtual tmp<symmTensorField> transformDiagTensor
(
const vectorField& vf
) const;
// Write // Write

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -146,37 +146,37 @@ Foam::axesRotation::axesRotation
Foam::tmp<Foam::vectorField> Foam::axesRotation::transform Foam::tmp<Foam::vectorField> Foam::axesRotation::transform
( (
const vectorField& st const vectorField& vf
) const ) const
{ {
return (R_ & st); return (R_ & vf);
} }
Foam::vector Foam::axesRotation::transform(const vector& st) const Foam::vector Foam::axesRotation::transform(const vector& v) const
{ {
return (R_ & st); return (R_ & v);
} }
Foam::tmp<Foam::vectorField> Foam::axesRotation::invTransform Foam::tmp<Foam::vectorField> Foam::axesRotation::invTransform
( (
const vectorField& st const vectorField& vf
) const ) const
{ {
return (Rtr_ & st); return (Rtr_ & vf);
} }
Foam::vector Foam::axesRotation::invTransform(const vector& st) const Foam::vector Foam::axesRotation::invTransform(const vector& v) const
{ {
return (Rtr_ & st); return (Rtr_ & v);
} }
Foam::tmp<Foam::tensorField> Foam::axesRotation::transformTensor Foam::tmp<Foam::tensorField> Foam::axesRotation::transform
( (
const tensorField& st const tensorField& tf
) const ) const
{ {
NotImplemented; NotImplemented;
@ -184,37 +184,39 @@ Foam::tmp<Foam::tensorField> Foam::axesRotation::transformTensor
} }
Foam::tensor Foam::axesRotation::transformTensor Foam::tensor Foam::axesRotation::transform
( (
const tensor& st const vector& p,
const tensor& t
) const ) const
{ {
return (R_ & st & Rtr_); return (R_ & t & Rtr_);
} }
Foam::tmp<Foam::symmTensorField> Foam::axesRotation::transformVector Foam::tmp<Foam::symmTensorField> Foam::axesRotation::transformDiagTensor
( (
const vectorField& st const vectorField& vf
) const ) const
{ {
tmp<symmTensorField> tfld(new symmTensorField(st.size())); tmp<symmTensorField> tfld(new symmTensorField(vf.size()));
symmTensorField& fld = tfld.ref(); symmTensorField& fld = tfld.ref();
forAll(fld, i) forAll(fld, i)
{ {
fld[i] = transformPrincipal(R_, st[i]); fld[i] = transformVectorDiagTensor(R_, vf[i]);
} }
return tfld; return tfld;
} }
Foam::symmTensor Foam::axesRotation::transformVector Foam::symmTensor Foam::axesRotation::transformDiagTensor
( (
const vector& st const vector& p,
const vector& v
) const ) const
{ {
return transformPrincipal(R_, st); return transformVectorDiagTensor(R_, v);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -154,34 +154,38 @@ public:
return Rtr_.z(); return Rtr_.z();
} }
//- Transform vectorField using transformation tensor field
virtual tmp<vectorField> transform(const vectorField& st) const;
//- Transform vector using transformation tensor //- Transform vector using transformation tensor
virtual vector transform(const vector& st) const; virtual vector transform(const vector& v) const;
//- Inverse transform vectorField using transformation tensor field //- Transform vectorField using transformation tensor field
virtual tmp<vectorField> invTransform(const vectorField& st) const; virtual tmp<vectorField> transform(const vectorField& tf) const;
//- Inverse transform vector using transformation tensor //- Inverse transform vector using transformation tensor
virtual vector invTransform(const vector& st) const; virtual vector invTransform(const vector& v) const;
//- Transform tensor field using transformation tensorField //- Inverse transform vectorField using transformation tensor field
virtual tmp<tensorField> transformTensor(const tensorField& st) const; virtual tmp<vectorField> invTransform(const vectorField& vf) const;
//- Transform tensor using transformation tensorField //- Transform tensor using transformation tensorField
virtual tensor transformTensor(const tensor& st) const; virtual tensor transform(const vector& p, const tensor& t) const;
//- Transform vectorField using transformation tensorField and return //- Transform tensor field using transformation tensorField
// symmetric tensorField virtual tmp<tensorField> transform(const tensorField& tf) const;
virtual tmp<symmTensorField> transformVector
//- Transform diagTensor masquerading as a vector using transformation
// tensor and return symmTensor
virtual symmTensor transformDiagTensor
( (
const vectorField& st const vector& p,
const vector& v
) const; ) const;
//- Transform vector using transformation tensor and return //- Transform diagTensorField masquerading as a vectorField
// symmetric tensor // using transformation tensorField and return symmTensorField
virtual symmTensor transformVector(const vector& st) const; virtual tmp<symmTensorField> transformDiagTensor
(
const vectorField& vf
) const;
// Member Operators // Member Operators

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -39,7 +39,7 @@ namespace Foam
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::symmTensor Foam::coordinateRotation::transformPrincipal Foam::symmTensor Foam::coordinateRotation::transformVectorDiagTensor
( (
const tensor& tt, const tensor& tt,
const vector& st const vector& st

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -74,8 +74,12 @@ protected:
// Protected member functions // Protected member functions
//- Transform principal //- Transform the vector as if it is a diagonal tensor
symmTensor transformPrincipal(const tensor&, const vector&) const; symmTensor transformVectorDiagTensor
(
const tensor&,
const vector&
) const;
public: public:
@ -162,35 +166,43 @@ public:
} }
//- Transform vector using transformation tensor //- Transform vector using transformation tensor
virtual vector transform(const vector& st) const = 0; virtual vector transform(const vector& v) const = 0;
//- Transform vectorField using transformation tensor field //- Transform vectorField using transformation tensor field
virtual tmp<vectorField> transform(const vectorField& st) const = 0; virtual tmp<vectorField> transform(const vectorField& vf) const = 0;
//- Inverse transform vector using transformation tensor //- Inverse transform vector using transformation tensor
virtual vector invTransform(const vector& st) const = 0; virtual vector invTransform(const vector& v) const = 0;
//- Inverse transform vectorField using transformation tensor field //- Inverse transform vectorField using transformation tensor field
virtual tmp<vectorField> invTransform(const vectorField& st) const = 0; virtual tmp<vectorField> invTransform(const vectorField& vf) const = 0;
//- Transform tensor using transformation tensorField //- Transform tensor using transformation tensorField
virtual tensor transformTensor(const tensor& st) const = 0; virtual tensor transform
//- Transform tensor field using transformation tensorField
virtual tmp<tensorField> transformTensor
( (
const tensorField& st const vector& p,
const tensor& t
) const = 0; ) const = 0;
//- Transform vector using transformation tensor and return //- Transform tensor field using transformation tensorField
// symmetrical tensor virtual tmp<tensorField> transform
virtual symmTensor transformVector(const vector& st) const = 0;
//- Transform vectorField using transformation tensorField and return
// symmetrical tensorField
virtual tmp<symmTensorField> transformVector
( (
const vectorField& st const tensorField& tf
) const = 0;
//- Transform diagTensor masquerading as a vector using transformation
// tensor and return symmTensor
virtual symmTensor transformDiagTensor
(
const vector& p,
const vector& v
) const = 0;
//- Transform diagTensorField masquerading as a vectorField
// using transformation tensorField and return symmTensorField
virtual tmp<symmTensorField> transformDiagTensor
(
const vectorField& vf
) const = 0; ) const = 0;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -204,7 +204,7 @@ Foam::vector Foam::cylindrical::invTransform
} }
Foam::tmp<Foam::tensorField> Foam::cylindrical::transformTensor Foam::tmp<Foam::tensorField> Foam::cylindrical::transform
( (
const tensorField& tf const tensorField& tf
) const ) const
@ -219,17 +219,18 @@ Foam::tmp<Foam::tensorField> Foam::cylindrical::transformTensor
} }
Foam::tensor Foam::cylindrical::transformTensor Foam::tensor Foam::cylindrical::transform
( (
const vector& p,
const tensor& t const tensor& t
) const ) const
{ {
NotImplemented; const tensor R(this->R(p));
return Zero; return (R & t & R.T());
} }
Foam::tmp<Foam::symmTensorField> Foam::cylindrical::transformVector Foam::tmp<Foam::symmTensorField> Foam::cylindrical::transformDiagTensor
( (
const vectorField& vf const vectorField& vf
) const ) const
@ -247,19 +248,19 @@ Foam::tmp<Foam::symmTensorField> Foam::cylindrical::transformVector
const tensorField& R = Rptr_(); const tensorField& R = Rptr_();
forAll(fld, i) forAll(fld, i)
{ {
fld[i] = transformPrincipal(R[i], vf[i]); fld[i] = transformVectorDiagTensor(R[i], vf[i]);
} }
return tfld; return tfld;
} }
Foam::symmTensor Foam::cylindrical::transformVector Foam::symmTensor Foam::cylindrical::transformDiagTensor
( (
const vector& p,
const vector& v const vector& v
) const ) const
{ {
NotImplemented; return transformVectorDiagTensor(R(p), v);
return Zero;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -185,18 +185,22 @@ public:
virtual vector invTransform(const vector& v, const label cmptI) const; virtual vector invTransform(const vector& v, const label cmptI) const;
//- Transform tensor using transformation tensorField //- Transform tensor using transformation tensorField
virtual tensor transformTensor(const tensor& t) const; virtual tensor transform(const vector& p, const tensor& t) const;
//- Transform tensor field using transformation tensorField //- Transform tensor field using transformation tensorField
virtual tmp<tensorField> transformTensor(const tensorField& tf) const; virtual tmp<tensorField> transform(const tensorField& tf) const;
//- Transform vector using transformation tensor and return //- Transform diagTensor masquerading as a vector using transformation
// symmetrical tensor // tensor and return symmTensor
virtual symmTensor transformVector(const vector& v) const; virtual symmTensor transformDiagTensor
(
const vector& p,
const vector& v
) const;
//- Transform vectorField using transformation tensorField and return //- Transform diagTensorField masquerading as a vectorField
// symmetrical tensorField // using transformation tensorField and return symmTensorField
virtual tmp<symmTensorField> transformVector virtual tmp<symmTensorField> transformDiagTensor
( (
const vectorField& vf const vectorField& vf
) const; ) const;

View File

@ -5,8 +5,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/radiationModels/lnInclude \ -I$(LIB_SRC)/radiationModels/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
-I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \ -I$(LIB_SRC)/ThermophysicalTransportModels/lnInclude \
-I$(LIB_SRC)/ThermophysicalTransportModels/solidThermophysicalTransportModels/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/mesh/extrudeModel/lnInclude \ -I$(LIB_SRC)/mesh/extrudeModel/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
@ -16,8 +16,8 @@ LIB_LIBS = \
-lregionModels \ -lregionModels \
-lsolidThermo \ -lsolidThermo \
-lmomentumTransportModels \ -lmomentumTransportModels \
-lcompressibleMomentumTransportModels \ -lsolidThermophysicalTransportModels \
-lthermophysicalTransportModels \ -lcoupledThermophysicalTransportModels \
-lradiationModels \ -lradiationModels \
-ldynamicMesh \ -ldynamicMesh \
-lfiniteVolume \ -lfiniteVolume \

View File

@ -47,7 +47,7 @@ defineTypeNameAndDebug(thermalBaffle, 0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
tmp<volScalarField::Internal> thermalBaffle::calcDelta() const tmp<volScalarField::Internal> thermalBaffle::calcThickness() const
{ {
if (intCoupledPatchIDs_.size() != 2) if (intCoupledPatchIDs_.size() != 2)
{ {
@ -131,7 +131,7 @@ tmp<volScalarField::Internal> thermalBaffle::calcDelta() const
); );
// Unpack distances into a dimensioned field and return // Unpack distances into a dimensioned field and return
tmp<volScalarField::Internal> tDelta tmp<volScalarField::Internal> tThickness
( (
new volScalarField::Internal new volScalarField::Internal
( (
@ -148,7 +148,7 @@ tmp<volScalarField::Internal> thermalBaffle::calcDelta() const
dimLength dimLength
) )
); );
volScalarField::Internal& delta = tDelta.ref(); volScalarField::Internal& thickness = tThickness.ref();
forAll(cellInfoDeltas, celli) forAll(cellInfoDeltas, celli)
{ {
@ -162,10 +162,10 @@ tmp<volScalarField::Internal> thermalBaffle::calcDelta() const
<< exit(FatalError); << exit(FatalError);
} }
delta[celli] = cellInfoDeltas[celli].data(); thickness[celli] = cellInfoDeltas[celli].data();
} }
return tDelta; return tThickness;
} }
@ -189,40 +189,17 @@ void thermalBaffle::solveEnergy()
{ {
DebugInFunction << endl; DebugInFunction << endl;
// Modify thermo density and diffusivity to take into account the thickness volScalarField& e = thermo_->he();
volScalarField dByT const volScalarField& rho = thermo_->rho();
(
volScalarField::New
(
"dByT",
regionMesh(),
dimless,
extrapolatedCalculatedFvPatchField<scalar>::typeName
)
);
dByT.ref() = delta_/thickness_;
dByT.correctBoundaryConditions();
const volScalarField rho("rho", thermo_->rho()*dByT);
const volScalarField alphahe("alphahe", thermo_->alphahe()*dByT);
fvScalarMatrix hEqn fvScalarMatrix hEqn
( (
fvm::ddt(rho, he_) fvm::ddt(rho, e)
- fvm::laplacian(alphahe, he_) + thermophysicalTransport_->divq(e)
== ==
Q_ + Qs_/thickness_ Q_ + Qs_/thickness_
); );
if (regionMesh().moving())
{
surfaceScalarField phiMesh
(
fvc::interpolate(rho*he_)*regionMesh().phi()
);
hEqn -= fvc::div(phiMesh);
}
hEqn.relax(); hEqn.relax();
hEqn.solve(); hEqn.solve();
@ -243,22 +220,10 @@ thermalBaffle::thermalBaffle
) )
: :
regionModel(mesh, "thermalBaffle", modelType, dict, true), regionModel(mesh, "thermalBaffle", modelType, dict, true),
delta_(calcDelta()), thickness_(calcThickness()),
thickness_
(
IOobject
(
"thickness",
regionMesh().pointsInstance(),
regionMesh(),
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
),
delta_
),
nNonOrthCorr_(solution().lookup<label>("nNonOrthCorr")), nNonOrthCorr_(solution().lookup<label>("nNonOrthCorr")),
thermo_(solidThermo::New(regionMesh())), thermo_(solidThermo::New(regionMesh())),
he_(thermo_->he()), thermophysicalTransport_(solidThermophysicalTransportModel::New(thermo())),
Qs_ Qs_
( (
IOobject IOobject
@ -319,36 +284,6 @@ void thermalBaffle::evolveRegion()
} }
const tmp<volScalarField> thermalBaffle::Cp() const
{
return thermo_->Cp();
}
const volScalarField& thermalBaffle::kappaRad() const
{
return radiation_->absorptionEmission().a();
}
const volScalarField& thermalBaffle::rho() const
{
return thermo_->rho();
}
const volScalarField& thermalBaffle::kappa() const
{
return thermo_->kappa();
}
const volScalarField& thermalBaffle::T() const
{
return thermo_->T();
}
const solidThermo& thermalBaffle::thermo() const const solidThermo& thermalBaffle::thermo() const
{ {
return thermo_; return thermo_;
@ -362,7 +297,7 @@ void thermalBaffle::info()
forAll(coupledPatches, i) forAll(coupledPatches, i)
{ {
const label patchi = coupledPatches[i]; const label patchi = coupledPatches[i];
const fvPatchScalarField& phe = he_.boundaryField()[patchi]; const fvPatchScalarField& phe = thermo_->he().boundaryField()[patchi];
const word patchName = regionMesh().boundary()[patchi].name(); const word patchName = regionMesh().boundary()[patchi].name();
Info<< indent << "Q : " << patchName << indent Info<< indent << "Q : " << patchName << indent

View File

@ -36,10 +36,10 @@ SourceFiles
#ifndef thermalBaffle_H #ifndef thermalBaffle_H
#define thermalBaffle_H #define thermalBaffle_H
#include "radiationModel.H"
#include "regionModel.H" #include "regionModel.H"
#include "solidThermo.H" #include "solidThermo.H"
#include "volFieldsFwd.H" #include "solidThermophysicalTransportModel.H"
#include "radiationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -59,7 +59,7 @@ class thermalBaffle
// Private Member Functions // Private Member Functions
//- Calculate the baffle mesh thickness //- Calculate the baffle mesh thickness
tmp<volScalarField::Internal> calcDelta() const; tmp<volScalarField::Internal> calcThickness() const;
protected: protected:
@ -68,10 +68,7 @@ protected:
// Geometric parameters // Geometric parameters
//- Baffle mesh thickness //- Baffle thickness
volScalarField::Internal delta_;
//- Baffle physical thickness
volScalarField::Internal thickness_; volScalarField::Internal thickness_;
@ -86,8 +83,11 @@ protected:
//- Solid thermo //- Solid thermo
autoPtr<solidThermo> thermo_; autoPtr<solidThermo> thermo_;
//- Enthalpy/internal energy
volScalarField& he_; // Thermophysical transport
//- Pointer to the solid thermophysical transport model
autoPtr<solidThermophysicalTransportModel> thermophysicalTransport_;
// Source term fields // Source term fields
@ -154,24 +154,6 @@ public:
const solidThermo& thermo() const; const solidThermo& thermo() const;
// Fields
//- Return the film specific heat capacity [J/kg/K]
const tmp<volScalarField> Cp() const;
//- Return solid absorptivity [1/m]
const volScalarField& kappaRad() const;
//- Return temperature [K]
const volScalarField& T() const;
//- Return density [Kg/m^3]
const volScalarField& rho() const;
//- Return thermal conductivity [W/m/K]
const volScalarField& kappa() const;
// Evolution // Evolution
//- Pre-evolve thermal baffle //- Pre-evolve thermal baffle

View File

@ -268,6 +268,8 @@ Foam::basicThermo::implementation::implementation
: :
physicalProperties(mesh, phaseName), physicalProperties(mesh, phaseName),
mesh_(mesh),
phaseName_(phaseName), phaseName_(phaseName),
T_ T_

View File

@ -200,6 +200,9 @@ public:
//- Non-const access the properties dictionary //- Non-const access the properties dictionary
virtual IOdictionary& properties() = 0; virtual IOdictionary& properties() = 0;
//- Return const access to the mesh
virtual const fvMesh& mesh() const = 0;
//- Phase name //- Phase name
virtual const word& phaseName() const = 0; virtual const word& phaseName() const = 0;
@ -427,6 +430,12 @@ class basicThermo::implementation
virtual public basicThermo, virtual public basicThermo,
public physicalProperties public physicalProperties
{ {
// Private Member Data
//- Reference to the mesh
const fvMesh& mesh_;
protected: protected:
// Protected data // Protected data
@ -484,6 +493,12 @@ public:
return *this; return *this;
} }
//- Return const access to the mesh
virtual const fvMesh& mesh() const
{
return mesh_;
}
//- Phase name //- Phase name
virtual const word& phaseName() const virtual const word& phaseName() const
{ {

View File

@ -53,7 +53,7 @@ Foam::heThermo<BasicThermo, MixtureType>::volScalarFieldProperty
volScalarField::New volScalarField::New
( (
IOobject::groupName(psiName, this->group()), IOobject::groupName(psiName, this->group()),
this->T_.mesh(), this->mesh(),
psiDim psiDim
) )
); );

View File

@ -70,13 +70,13 @@ Foam::basicChemistryModel::basicChemistryModel
IOobject IOobject
( (
thermo.phasePropertyName("chemistryProperties"), thermo.phasePropertyName("chemistryProperties"),
thermo.T().mesh().time().constant(), thermo.mesh().time().constant(),
thermo.T().mesh(), thermo.mesh(),
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE IOobject::NO_WRITE
) )
), ),
mesh_(thermo.T().mesh()), mesh_(thermo.mesh()),
thermo_(thermo), thermo_(thermo),
chemistry_(lookup("chemistry")), chemistry_(lookup("chemistry")),
deltaTChemIni_(lookup<scalar>("initialChemicalTimeStep")), deltaTChemIni_(lookup<scalar>("initialChemicalTimeStep")),

View File

@ -74,7 +74,7 @@ protected:
// Protected data // Protected data
//- Reference to the mesh database //- Reference to the mesh
const fvMesh& mesh_; const fvMesh& mesh_;
//- Reference to the thermo //- Reference to the thermo
@ -140,7 +140,7 @@ public:
// Member Functions // Member Functions
//- Return const access to the mesh database //- Return const access to the mesh
inline const fvMesh& mesh() const; inline const fvMesh& mesh() const;
//- Return const access to the thermo //- Return const access to the thermo

View File

@ -39,8 +39,8 @@ Foam::autoPtr<Foam::basicChemistryModel> Foam::basicChemistryModel::New
IOobject IOobject
( (
thermo.phasePropertyName("chemistryProperties"), thermo.phasePropertyName("chemistryProperties"),
thermo.T().mesh().time().constant(), thermo.mesh().time().constant(),
thermo.T().mesh(), thermo.mesh(),
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false false

View File

@ -81,7 +81,7 @@ Foam::chemistryModel<ThermoType>::chemistryModel
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
thermo.T().mesh(), thermo.mesh(),
dimensionedScalar(dimMass/dimVolume/dimTime, 0) dimensionedScalar(dimMass/dimVolume/dimTime, 0)
) )
); );

View File

@ -72,7 +72,7 @@ Foam::laminarFlameSpeedModels::constant::operator()() const
return volScalarField::New return volScalarField::New
( (
"Su0", "Su0",
psiuMulticomponentThermo_.T().mesh(), psiuMulticomponentThermo_.mesh(),
Su_ Su_
); );
} }

View File

@ -120,7 +120,7 @@ public:
//- Isotropic thermal conductivity [W/m/K] //- Isotropic thermal conductivity [W/m/K]
inline scalar kappa(const scalar p, const scalar T) const; inline scalar kappa(const scalar p, const scalar T) const;
//- Un-isotropic thermal conductivity [W/m/K] //- Anisotropic thermal conductivity [W/m/K]
inline vector Kappa(const scalar p, const scalar T) const; inline vector Kappa(const scalar p, const scalar T) const;
//- Dynamic viscosity [kg/m/s] //- Dynamic viscosity [kg/m/s]

View File

@ -121,7 +121,7 @@ public:
//- Isotropic thermal conductivity [W/m/K] //- Isotropic thermal conductivity [W/m/K]
inline scalar kappa(const scalar p, const scalar T) const; inline scalar kappa(const scalar p, const scalar T) const;
//- Un-isotropic thermal conductivity [W/m/K] //- Anisotropic thermal conductivity [W/m/K]
inline vector Kappa(const scalar p, const scalar T) const; inline vector Kappa(const scalar p, const scalar T) const;
//- Dynamic viscosity [kg/m/s] //- Dynamic viscosity [kg/m/s]

View File

@ -190,7 +190,7 @@ template<class BasicSolidThermo, class MixtureType>
Foam::tmp<Foam::volVectorField> Foam::tmp<Foam::volVectorField>
Foam::heSolidThermo<BasicSolidThermo, MixtureType>::Kappa() const Foam::heSolidThermo<BasicSolidThermo, MixtureType>::Kappa() const
{ {
const fvMesh& mesh = this->T_.mesh(); const fvMesh& mesh = this->mesh();
tmp<volVectorField> tKappa tmp<volVectorField> tKappa
( (
@ -268,113 +268,4 @@ Foam::heSolidThermo<BasicSolidThermo, MixtureType>::Kappa
} }
template<class BasicSolidThermo, class MixtureType>
Foam::tmp<Foam::volSymmTensorField>
Foam::heSolidThermo<BasicSolidThermo, MixtureType>::KappaLocal() const
{
const fvMesh& mesh = this->T_.mesh();
const coordinateSystem coordinates
(
coordinateSystem::New(mesh, this->properties())
);
const tmp<volVectorField> tKappa(Kappa());
const volVectorField& Kappa = tKappa();
tmp<volSymmTensorField> tKappaLocal
(
volSymmTensorField::New
(
"KappaLocal",
mesh,
dimensionedSymmTensor(Kappa.dimensions(), Zero)
)
);
volSymmTensorField& KappaLocal = tKappaLocal.ref();
KappaLocal.primitiveFieldRef() =
coordinates.R(mesh.C()).transformVector(Kappa);
forAll(KappaLocal.boundaryField(), patchi)
{
KappaLocal.boundaryFieldRef()[patchi] =
coordinates.R(mesh.boundary()[patchi].Cf())
.transformVector(Kappa.boundaryField()[patchi]);
}
return tKappaLocal;
}
template<class BasicSolidThermo, class MixtureType>
Foam::tmp<Foam::symmTensorField>
Foam::heSolidThermo<BasicSolidThermo, MixtureType>::KappaLocal
(
const label patchi
) const
{
const fvMesh& mesh = this->T_.mesh();
const coordinateSystem coordinates
(
coordinateSystem::New(mesh, this->properties())
);
return
coordinates.R(mesh.boundary()[patchi].Cf())
.transformVector(Kappa(patchi));
}
template<class BasicSolidThermo, class MixtureType>
Foam::tmp<Foam::surfaceScalarField>
Foam::heSolidThermo<BasicSolidThermo, MixtureType>::q() const
{
const fvMesh& mesh = this->T_.mesh();
mesh.schemes().setFluxRequired(this->T_.name());
return
- (
isotropic()
? fvm::laplacian(this->kappa(), this->T_)().flux()
: fvm::laplacian(KappaLocal(), this->T_)().flux()
)/mesh.magSf();
}
template<class BasicSolidThermo, class MixtureType>
Foam::tmp<Foam::fvScalarMatrix>
Foam::heSolidThermo<BasicSolidThermo, MixtureType>::divq
(
volScalarField& e
) const
{
return
- (
isotropic()
? fvc::laplacian(this->kappa(), this->T_)
+ correction
(
fvm::laplacian
(
this->kappa()/this->Cv(),
e,
"laplacian(alphae,e)"
)
)
: fvc::laplacian(KappaLocal(), this->T_)
+ correction
(
fvm::laplacian
(
KappaLocal()/this->Cv(),
e,
"laplacian(alphae,e)"
)
)
);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -56,9 +56,6 @@ class heSolidThermo
//- Calculate the thermo variables //- Calculate the thermo variables
void calculate(); void calculate();
//- Return the anisotropic Kappa in the local coordinate system
tmp<volSymmTensorField> KappaLocal() const;
public: public:
@ -103,16 +100,6 @@ public:
//- Anisotropic thermal conductivity [W/m/K] //- Anisotropic thermal conductivity [W/m/K]
virtual tmp<vectorField> Kappa(const label patchi) const; virtual tmp<vectorField> Kappa(const label patchi) const;
//- Anisotropic thermal conductivity for patch
// in the local coordinate system [W/m/K]
virtual tmp<symmTensorField> KappaLocal(const label patchi) const;
//- Return the heat flux [W/m^2]
virtual tmp<surfaceScalarField> q() const;
//- Return the source term for the energy equation
virtual tmp<fvScalarMatrix> divq(volScalarField& he) const;
// Member Operators // Member Operators

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -117,16 +117,6 @@ public:
//- Anisotropic thermal conductivity for patch [W/m/K] //- Anisotropic thermal conductivity for patch [W/m/K]
virtual tmp<vectorField> Kappa(const label patchi) const = 0; virtual tmp<vectorField> Kappa(const label patchi) const = 0;
//- Anisotropic thermal conductivity for patch
// in the local coordinate system [W/m/K]
virtual tmp<symmTensorField> KappaLocal(const label patchi) const = 0;
//- Return the heat flux [W]
virtual tmp<surfaceScalarField> q() const = 0;
//- Return the source term for the energy equation
virtual tmp<fvScalarMatrix> divq(volScalarField& he) const = 0;
}; };

View File

@ -31,8 +31,7 @@ gradSchemes
laplacianSchemes laplacianSchemes
{ {
default none; default Gauss linear uncorrected;
laplacian(alphahe,e) Gauss linear uncorrected;
} }