solvers::solid,solidDisplacement: Provided public constant access to state fields

This commit is contained in:
Henry Weller
2023-04-07 16:47:59 +01:00
parent 2b74f9486f
commit 983cba0dca
7 changed files with 91 additions and 70 deletions

View File

@ -87,14 +87,17 @@ Foam::solvers::solid::solid
:
solver(mesh),
thermo_(thermoPtr),
thermo(thermo_()),
thermoPtr_(thermoPtr),
thermo_(thermoPtr_()),
T(thermo.T()),
T_(thermo_.T()),
thermophysicalTransport(solidThermophysicalTransportModel::New(thermo)),
thermophysicalTransport(solidThermophysicalTransportModel::New(thermo_)),
DiNum(0)
DiNum(0),
thermo(thermo_),
T(T_)
{
thermo.validate("solid", "h", "e");
@ -192,7 +195,7 @@ void Foam::solvers::solid::momentumPredictor()
void Foam::solvers::solid::thermophysicalPredictor()
{
volScalarField& e = thermo.he();
volScalarField& e = thermo_.he();
const volScalarField& rho = thermo.rho();
while (pimple.correctNonOrthogonal())
@ -214,7 +217,7 @@ void Foam::solvers::solid::thermophysicalPredictor()
fvConstraints().constrain(e);
}
thermo.correct();
thermo_.correct();
}

View File

@ -67,11 +67,11 @@ protected:
// Thermophysical properties
autoPtr<solidThermo> thermo_;
autoPtr<solidThermo> thermoPtr_;
solidThermo& thermo;
solidThermo& thermo_;
volScalarField& T;
volScalarField& T_;
// Thermophysical transport
@ -101,6 +101,15 @@ private:
public:
// Public Data
//- Reference to the solid thermophysical properties
const solidThermo& thermo;
//- Reference to the temperature field
const volScalarField& T;
//- Runtime type information
TypeName("solid");