isotropic.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "isotropic.H"
27 #include "fvmLaplacian.H"
28 #include "fvcLaplacian.H"
29 #include "fvcSnGrad.H"
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 namespace solidThermophysicalTransportModels
37 {
40  (
42  isotropic,
44  );
45 }
46 }
47 
48 
49 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
50 
52 (
53  const solidThermo& thermo
54 )
55 :
57 {
58  if (!thermo.isotropic())
59  {
61  << "Cannot instantiate an isotropic transport model "
62  "with anisotropic solid properties"
63  << exit(FatalIOError);
64  }
65 }
66 
67 
68 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
69 
70 const Foam::dictionary&
72 {
73  return dictionary::null;
74 }
75 
76 
78 {
79  return true;
80 }
81 
82 
85 {
87  (
88  "q",
90  );
91 }
92 
93 
96 (
97  const label patchi
98 ) const
99 {
100  return tmp<scalarField>(nullptr);
101 }
102 
103 
106 (
108 ) const
109 {
110  const solidThermo& thermo = this->thermo();
111 
112  // Return heat flux source as an implicit energy correction
113  // to the temperature gradient flux
114  return
115  -fvc::laplacian(kappa(), thermo.T())
117 }
118 
119 
121 {
123 }
124 
125 
126 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &)
Return a temporary field constructed from name,.
virtual const volScalarField & T() const =0
Temperature [K].
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
static const dictionary null
Null dictionary.
Definition: dictionary.H:242
Base-class for solid thermodynamic properties.
Definition: solidThermo.H:56
virtual bool isotropic() const =0
Return true if thermal conductivity is isotropic.
Abstract base class for solid thermophysical transport models.
virtual void predict()=0
Predict the thermophysical transport coefficients if possible.
virtual const solidThermo & thermo() const
Access function to solid thermophysical properties.
Solid thermophysical transport model for isotropic thermal conductivity.
Definition: isotropic.H:57
virtual tmp< scalarField > qCorr(const label patchi) const
Return null patch heat flux correction [W/m^2].
Definition: isotropic.C:96
virtual void predict()
Correct the isotropic viscosity.
Definition: isotropic.C:120
virtual const dictionary & coeffDict() const
Const access to the coefficients dictionary.
Definition: isotropic.C:71
virtual tmp< surfaceScalarField > q() const
Return the heat flux [W/m^2].
Definition: isotropic.C:84
isotropic(const solidThermo &thermo)
Construct from solid thermophysical properties.
Definition: isotropic.C:52
virtual bool read()
Read thermophysicalTransport dictionary.
Definition: isotropic.C:77
virtual tmp< fvScalarMatrix > divq(volScalarField &he) const
Return the source term for the energy equation.
Definition: isotropic.C:106
A class for managing temporary objects.
Definition: tmp.H:55
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:318
Calculate the laplacian of the given field.
Calculate the snGrad of the given volField.
Calculate the matrix for the laplacian of the field.
label patchi
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
tmp< VolField< Type > > laplacian(const VolField< Type > &vf, const word &name)
Definition: fvcLaplacian.C:45
tmp< SurfaceField< Type > > snGrad(const VolField< Type > &vf, const word &name)
Definition: fvcSnGrad.C:45
tmp< fvMatrix< Type > > laplacianCorrection(const VolField< scalar > &gamma, const VolField< Type > &vf)
Definition: fvmLaplacian.C:340
addToRunTimeSelectionTable(solidThermophysicalTransportModel, anisotropic, dictionary)
Namespace for OpenFOAM.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
const doubleScalar e
Definition: doubleScalar.H:105
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
IOerror FatalIOError
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
fluidMulticomponentThermo & thermo
Definition: createFields.H:31