Skip to content

Commit 020463b

Browse files
author
Henry Weller
committed
multiphaseEuler::SolidThermalPhaseModel: New thermal phase model for solid phases
which provides the energy equation specific for stationary solid phases.
1 parent 7b052fb commit 020463b

File tree

6 files changed

+205
-6
lines changed

6 files changed

+205
-6
lines changed

applications/modules/multiphaseEuler/multiphaseEuler/thermophysicalPredictor.C

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,12 @@ void Foam::solvers::multiphaseEuler::energyPredictor()
8585

8686
const volScalarField& alpha = phase;
8787
const volScalarField& rho = phase.rho();
88-
const tmp<volVectorField> tU(phase.U());
89-
const volVectorField& U(tU());
9088

9189
fvScalarMatrix EEqn
9290
(
9391
phase.heEqn()
9492
==
9593
*heatTransfer[phase.name()]
96-
+ alpha*rho*(U&buoyancy.g)
9794
+ fvModels().source(alpha, rho, phase.thermo().he())
9895
);
9996

applications/modules/multiphaseEuler/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ Foam::AnisothermalPhaseModel<BasePhaseModel>::AnisothermalPhaseModel
7171
const label index
7272
)
7373
:
74-
BasePhaseModel(fluid, phaseName, referencePhase, index)
74+
BasePhaseModel(fluid, phaseName, referencePhase, index),
75+
g_(fluid.mesh().lookupObject<uniformDimensionedVectorField>("g"))
7576
{}
7677

7778

@@ -132,7 +133,8 @@ Foam::AnisothermalPhaseModel<BasePhaseModel>::heEqn()
132133

133134
+ this->divq(he)
134135
==
135-
alpha*this->Qdot()
136+
alpha*rho*(U&g_)
137+
+ alpha*this->Qdot()
136138
);
137139

138140
// Add the appropriate pressure-work term

applications/modules/multiphaseEuler/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ SourceFiles
3737
#define AnisothermalPhaseModel_H
3838

3939
#include "phaseModel.H"
40+
#include "uniformDimensionedFields.H"
4041

4142
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
4243

@@ -52,6 +53,12 @@ class AnisothermalPhaseModel
5253
:
5354
public BasePhaseModel
5455
{
56+
// Private Member Data
57+
58+
//- Gravitational acceleration
59+
const uniformDimensionedVectorField& g_;
60+
61+
5562
// Private Member Functions
5663

5764
//- Optionally filter the pressure work term as the phase-fraction -> 0
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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+
30+
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31+
32+
template<class BasePhaseModel>
33+
Foam::SolidThermalPhaseModel<BasePhaseModel>::SolidThermalPhaseModel
34+
(
35+
const phaseSystem& fluid,
36+
const word& phaseName,
37+
const bool referencePhase,
38+
const label index
39+
)
40+
:
41+
BasePhaseModel(fluid, phaseName, referencePhase, index)
42+
{}
43+
44+
45+
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
46+
47+
template<class BasePhaseModel>
48+
Foam::SolidThermalPhaseModel<BasePhaseModel>::~SolidThermalPhaseModel()
49+
{}
50+
51+
52+
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
53+
54+
template<class BasePhaseModel>
55+
void Foam::SolidThermalPhaseModel<BasePhaseModel>::correctThermo()
56+
{
57+
BasePhaseModel::correctThermo();
58+
59+
this->thermo_->correct();
60+
}
61+
62+
63+
template<class BasePhaseModel>
64+
bool Foam::SolidThermalPhaseModel<BasePhaseModel>::isothermal() const
65+
{
66+
return false;
67+
}
68+
69+
70+
template<class BasePhaseModel>
71+
Foam::tmp<Foam::fvScalarMatrix>
72+
Foam::SolidThermalPhaseModel<BasePhaseModel>::heEqn()
73+
{
74+
const volScalarField& alpha = *this;
75+
const volScalarField& rho = this->rho();
76+
77+
volScalarField& he = this->thermo_->he();
78+
79+
tmp<fvScalarMatrix> tEEqn
80+
(
81+
fvm::ddt(alpha, rho, he)
82+
+ this->divq(he)
83+
==
84+
alpha*this->Qdot()
85+
);
86+
87+
return tEEqn;
88+
}
89+
90+
91+
// ************************************************************************* //
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
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+
Class
25+
Foam::SolidThermalPhaseModel
26+
27+
Description
28+
Class which represents a solid stationary phase for which the temperature
29+
(strictly energy) varies. Returns the energy equation and corrects the
30+
thermodynamic model.
31+
32+
SourceFiles
33+
SolidThermalPhaseModel.C
34+
35+
\*---------------------------------------------------------------------------*/
36+
37+
#ifndef SolidThermalPhaseModel_H
38+
#define SolidThermalPhaseModel_H
39+
40+
#include "phaseModel.H"
41+
42+
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43+
44+
namespace Foam
45+
{
46+
47+
/*---------------------------------------------------------------------------*\
48+
Class SolidThermalPhaseModel Declaration
49+
\*---------------------------------------------------------------------------*/
50+
51+
template<class BasePhaseModel>
52+
class SolidThermalPhaseModel
53+
:
54+
public BasePhaseModel
55+
{
56+
57+
public:
58+
59+
// Constructors
60+
61+
SolidThermalPhaseModel
62+
(
63+
const phaseSystem& fluid,
64+
const word& phaseName,
65+
const bool referencePhase,
66+
const label index
67+
);
68+
69+
70+
//- Destructor
71+
virtual ~SolidThermalPhaseModel();
72+
73+
74+
// Member Functions
75+
76+
//- Correct the thermodynamics
77+
virtual void correctThermo();
78+
79+
//- Return whether the phase is isothermal
80+
virtual bool isothermal() const;
81+
82+
//- Return the enthalpy equation
83+
virtual tmp<fvScalarMatrix> heEqn();
84+
};
85+
86+
87+
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
88+
89+
} // End namespace Foam
90+
91+
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92+
93+
#ifdef NoRepository
94+
#include "SolidThermalPhaseModel.C"
95+
#endif
96+
97+
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
98+
99+
#endif
100+
101+
// ************************************************************************* //

applications/modules/multiphaseEuler/phaseSystems/phaseModel/phaseModel/phaseModels.C

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ License
3434
#include "ThermoPhaseModel.H"
3535
#include "IsothermalPhaseModel.H"
3636
#include "AnisothermalPhaseModel.H"
37+
#include "SolidThermalPhaseModel.H"
3738
#include "PurePhaseModel.H"
3839
#include "MulticomponentPhaseModel.H"
3940
#include "InertPhaseModel.H"
@@ -74,7 +75,7 @@ namespace Foam
7475
);
7576

7677
typedef
77-
AnisothermalPhaseModel
78+
SolidThermalPhaseModel
7879
<
7980
PurePhaseModel
8081
<

0 commit comments

Comments
 (0)