Skip to content

Commit

Permalink
solidThermophysicalTransportModel: new thermophysical transport model…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
Henry Weller committed Oct 19, 2022
1 parent cc868b6 commit cdaaa61
Show file tree
Hide file tree
Showing 80 changed files with 1,576 additions and 612 deletions.
2 changes: 1 addition & 1 deletion applications/solvers/combustion/XiFoam/Make/options
Expand Up @@ -17,7 +17,7 @@ EXE_LIBS = \
-lmomentumTransportModels \
-lcompressibleMomentumTransportModels \
-lthermophysicalTransportModels \
-lfluidThermophysicalModels \
-lcoupledThermophysicalTransportModels \
-lmulticomponentThermophysicalModels \
-lspecie \
-llaminarFlameSpeedModels \
Expand Down
Expand Up @@ -41,7 +41,7 @@ EXE_LIBS = \
-lspecie \
-lmomentumTransportModels \
-lcompressibleMomentumTransportModels \
-lthermophysicalTransportModels \
-lcoupledThermophysicalTransportModels \
-llaminarFlameSpeedModels \
-lfiniteVolume \
-lfvModels \
Expand Down
Expand Up @@ -18,5 +18,5 @@ EXE_LIBS = \
-lrhoCentralFoam \
-lmomentumTransportModels \
-lcompressibleMomentumTransportModels \
-lthermophysicalTransportModels \
-lcoupledThermophysicalTransportModels \
-lmeshTools
Expand Up @@ -16,7 +16,7 @@ EXE_LIBS = \
-lspecie \
-lmomentumTransportModels \
-lcompressibleMomentumTransportModels \
-lthermophysicalTransportModels \
-lcoupledThermophysicalTransportModels \
-lfiniteVolume \
-lsampling \
-lmeshTools \
Expand Down
2 changes: 1 addition & 1 deletion applications/solvers/heatTransfer/thermoFoam/Make/options
Expand Up @@ -18,4 +18,4 @@ EXE_LIBS = \
-lspecie \
-lmomentumTransportModels \
-lcompressibleMomentumTransportModels \
-lthermophysicalTransportModels
-lcoupledThermophysicalTransportModels
2 changes: 1 addition & 1 deletion applications/solvers/modules/fluid/fluid/Make/options
Expand Up @@ -17,7 +17,7 @@ LIB_LIBS = \
-lfluidThermophysicalModels \
-lmomentumTransportModels \
-lcompressibleMomentumTransportModels \
-lthermophysicalTransportModels \
-lcoupledThermophysicalTransportModels \
-lfiniteVolume \
-lmeshTools \
-lsampling \
Expand Down
Expand Up @@ -28,7 +28,7 @@ LIB_LIBS = \
-lmulticomponentThermophysicalModels \
-lmomentumTransportModels \
-lcompressibleMomentumTransportModels \
-lthermophysicalTransportModels \
-lcoupledThermophysicalTransportModels \
-lfluidMulticomponentThermophysicalTransportModels \
-lfiniteVolume \
-lfvModels \
Expand Down
3 changes: 2 additions & 1 deletion applications/solvers/modules/solid/solid/Make/options
Expand Up @@ -2,13 +2,14 @@ EXE_INC = \
-I$(LIB_SRC)/physicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/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)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude

LIB_LIBS = \
-lsolidThermo \
-lsolidThermophysicalTransportModels \
-lspecie \
-lfiniteVolume \
-lmeshTools \
Expand Down
7 changes: 3 additions & 4 deletions applications/solvers/modules/solid/solid/solid.C
Expand Up @@ -76,9 +76,6 @@ void Foam::solvers::solid::correctDiNum()
}


// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //


// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

Foam::solvers::solid::solid(fvMesh& mesh)
Expand All @@ -90,6 +87,8 @@ Foam::solvers::solid::solid(fvMesh& mesh)

T(thermo.T()),

thermophysicalTransport(solidThermophysicalTransportModel::New(thermo)),

DiNum(0)
{
// Read the controls
Expand Down Expand Up @@ -174,7 +173,7 @@ void Foam::solvers::solid::thermophysicalPredictor()
fvScalarMatrix eEqn
(
fvm::ddt(rho, e)
+ thermo.divq(e)
+ thermophysicalTransport->divq(e)
==
fvModels().source(rho, e)
);
Expand Down
8 changes: 7 additions & 1 deletion applications/solvers/modules/solid/solid/solid.H
Expand Up @@ -38,7 +38,7 @@ SourceFiles
#define solid_H

#include "solver.H"
#include "solidThermo.H"
#include "solidThermophysicalTransportModel.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Expand Down Expand Up @@ -74,6 +74,12 @@ protected:
volScalarField& T;


// Thermophysical transport

//- Pointer to the solid thermophysical transport model
autoPtr<solidThermophysicalTransportModel> thermophysicalTransport;


// Time-step controls

scalar DiNum;
Expand Down
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -349,7 +349,7 @@ public:

// Transport

//- Effective thermal turbulent diffusivity for temperature
//- Effective thermal turbulent conductivity
// of mixture for patch [W/m/K]
virtual tmp<scalarField> kappaEff(const label patchi) const = 0;

Expand Down
Expand Up @@ -6,13 +6,15 @@ EXE_INC = \
-I$(LIB_SRC)/physicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/ThermophysicalTransportModels/solidThermophysicalTransportModels/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude

EXE_LIBS = \
-lfiniteVolume \
-lsolidThermo \
-lsolidDisplacementThermo \
-lsolidThermophysicalTransportModels \
-lfiniteVolume \
-lmeshTools \
-lfvModels \
-lfvConstraints \
-lmeshTools
-lfvConstraints
Expand Up @@ -2,6 +2,13 @@ Info<< "Reading thermophysical properties\n" << endl;

solidDisplacementThermo thermo(mesh);

autoPtr<solidThermophysicalTransportModel> thermophysicalTransport;

if (thermo.thermalStress())
{
thermophysicalTransport = solidThermophysicalTransportModel::New(thermo);
}

const volScalarField& E(thermo.E());
const volScalarField& nu(thermo.nu());

Expand Down
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -37,6 +37,7 @@ Description

#include "fvCFD.H"
#include "solidDisplacementThermo.H"
#include "solidThermophysicalTransportModel.H"
#include "fvModels.H"
#include "fvConstraints.H"

Expand Down Expand Up @@ -76,7 +77,7 @@ int main(int argc, char *argv[])
fvScalarMatrix TEqn
(
fvm::ddt(rho, Cp, T)
+ thermo.divq(T)
+ thermophysicalTransport->divq(T)
==
fvModels.source(rho*Cp, T)
);
Expand Down
Expand Up @@ -61,7 +61,7 @@ class solidDisplacementThermo
//- Heat capacity at constant pressure [J/kg/K]
volScalarField Cp_;

//- Thermal diffusivity for temperature [W/m/K]
//- Thermal conductivity [W/m/K]
volScalarField kappa_;

//- Youngs modulus [Pa]
Expand Down Expand Up @@ -176,7 +176,7 @@ public:

// 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;


Expand Down Expand Up @@ -314,7 +314,7 @@ public:
//- Thermal diffusivity for energy of mixture for patch [kg/m/s]
virtual tmp<scalarField> alphahe(const label patchi) const;

//- Effective thermal turbulent diffusivity for temperature
//- Effective thermal turbulent conductivity
// of mixture [W/m/K]
virtual tmp<volScalarField> kappaEff
(
Expand All @@ -327,7 +327,7 @@ public:
const volScalarField& alphat
) const;

//- Effective thermal turbulent diffusivity for temperature
//- Effective thermal turbulent conductivity
// of mixture for patch [W/m/K]
virtual tmp<scalarField> kappaEff
(
Expand Down
Expand Up @@ -6,11 +6,13 @@ EXE_INC = \
-I$(LIB_SRC)/physicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/ThermophysicalTransportModels/solidThermophysicalTransportModels/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude

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

#include "fvCFD.H"
#include "solidDisplacementThermo.H"
#include "solidThermophysicalTransportModel.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Expand Down
4 changes: 2 additions & 2 deletions src/OpenFOAM/meshes/polyMesh/polyMesh.H
Expand Up @@ -307,7 +307,7 @@ protected:
//- Is the mesh moving
bool moving_;

//- Is the mesh topology changing
//- Has the mesh topology changed
bool topoChanged_;


Expand Down Expand Up @@ -528,7 +528,7 @@ public:
return moving_;
}

//- Is mesh topology changing
//- Has the mesh topology changed
bool topoChanged() const
{
return topoChanged_;
Expand Down
2 changes: 2 additions & 0 deletions src/ThermophysicalTransportModels/Allwmake
Expand Up @@ -8,5 +8,7 @@ wmake $targetType
wmake $targetType fluidMulticomponentThermo
wmake $targetType phaseFluidThermo
wmake $targetType phaseFluidMulticomponentThermo
wmake $targetType solidThermophysicalTransportModels
wmake $targetType coupledThermophysicalTransportModels

#------------------------------------------------------------------------------
3 changes: 0 additions & 3 deletions src/ThermophysicalTransportModels/Make/files
@@ -1,9 +1,6 @@
thermophysicalTransportModel/thermophysicalTransportModel.C

BCs = derivedFvPatchFields
$(BCs)/externalTemperature/externalTemperatureFvPatchScalarField.C
$(BCs)/temperatureCoupledBase/temperatureCoupledBase.C
$(BCs)/coupledTemperature/coupledTemperatureFvPatchScalarField.C
$(BCs)/thermalBaffle1D/thermalBaffle1DFvPatchScalarFields.C
$(BCs)/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C
$(BCs)/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C
Expand Down
@@ -0,0 +1,5 @@
externalTemperature/externalTemperatureFvPatchScalarField.C
patchKappa/patchKappa.C
coupledTemperature/coupledTemperatureFvPatchScalarField.C

LIB = $(FOAM_LIBBIN)/libcoupledThermophysicalTransportModels
@@ -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

0 comments on commit cdaaa61

Please sign in to comment.