SolidThermalPhaseModel.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) 2023 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 "SolidThermalPhaseModel.H"
27 #include "fvmDdt.H"
28 #include "fvmSup.H"
29 #include "fvcLaplacian.H"
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
33 template<class BasePhaseModel>
35 (
36  const phaseSystem& fluid,
37  const word& phaseName,
38  const bool referencePhase,
39  const label index
40 )
41 :
42  BasePhaseModel(fluid, phaseName, referencePhase, index),
43  thermophysicalTransport_
44  (
45  phaseSolidThermophysicalTransportModel::New(*this, this->thermo_)
46  )
47 {}
48 
49 
50 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
51 
52 template<class BasePhaseModel>
54 {}
55 
56 
57 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
58 
59 template<class BasePhaseModel>
61 {
62  return false;
63 }
64 
65 
66 template<class BasePhaseModel>
68 {
69  BasePhaseModel::correctThermo();
70 
71  this->thermo_->correct();
72 }
73 
74 
75 template<class BasePhaseModel>
78 {
79  BasePhaseModel::predictThermophysicalTransport();
80  thermophysicalTransport_->predict();
81 }
82 
83 
84 template<class BasePhaseModel>
87 {
88  BasePhaseModel::correctThermophysicalTransport();
89  thermophysicalTransport_->correct();
90 }
91 
92 
93 template<class BasePhaseModel>
96 {
97  return thermophysicalTransport_->kappaEff(patchi);
98 }
99 
100 
101 template<class BasePhaseModel>
104 {
105  return thermophysicalTransport_->divq(he);
106 }
107 
108 
109 template<class BasePhaseModel>
112 {
113  const volScalarField& alpha = *this;
114  const volScalarField& rho = this->rho();
115 
116  volScalarField& he = this->thermo_->he();
117 
118  tmp<fvScalarMatrix> tEEqn
119  (
120  fvm::ddt(alpha, rho, he)
121  + this->divq(he)
122  ==
123  alpha*this->Qdot()
124  );
125 
126  return tEEqn;
127 }
128 
129 
130 // ************************************************************************* //
Generic GeometricField class.
virtual void correctThermo()
Correct the thermodynamics.
virtual void predictThermophysicalTransport()
Predict the energy transport e.g. alphat.
virtual ~SolidThermalPhaseModel()
Destructor.
virtual void correctThermophysicalTransport()
Correct the energy transport e.g. alphat.
virtual bool isothermal() const
Return whether the phase is isothermal.
SolidThermalPhaseModel(const phaseSystem &fluid, const word &phaseName, const bool referencePhase, const label index)
virtual tmp< fvScalarMatrix > heEqn()
Return the enthalpy equation.
virtual tmp< scalarField > kappaEff(const label patchi) const
Return the effective thermal conductivity on a patch.
virtual tmp< fvScalarMatrix > divq(volScalarField &he) const
Return the source term for the energy equation.
Abstract base class for solid thermophysical transport models.
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:73
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Calculate the laplacian of the given field.
Calculate the matrix for the first temporal derivative.
Calculate the matrix for implicit and explicit sources.
label patchi
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
autoPtr< CompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const viscosity &viscosity)
tmp< fvMatrix< Type > > ddt(const VolField< Type > &vf)
Definition: fvmDdt.C:46
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
thermo he()
scalar Qdot
Definition: solveChemistry.H:2