heThermo: Simplified initialisation and fixed Clang optimisation issue
The initialisation of energy in heThermo has been rewritten to use the "he" method. This has had the effect of resolving a floating point error in the initialisation by disabling Clang's vectorisation of the loop in which cell values of energy are calculated from the temperature field.
This commit is contained in:
@ -29,34 +29,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class BasicThermo, class MixtureType>
|
|
||||||
void Foam::heThermo<BasicThermo, MixtureType>::init()
|
|
||||||
{
|
|
||||||
scalarField& heCells = he_.primitiveFieldRef();
|
|
||||||
const scalarField& pCells = this->p();
|
|
||||||
const scalarField& TCells = this->T_;
|
|
||||||
|
|
||||||
forAll(heCells, celli)
|
|
||||||
{
|
|
||||||
heCells[celli] =
|
|
||||||
this->cellMixture(celli).HE(pCells[celli], TCells[celli]);
|
|
||||||
}
|
|
||||||
|
|
||||||
volScalarField::Boundary& heBf = he_.boundaryFieldRef();
|
|
||||||
|
|
||||||
forAll(heBf, patchi)
|
|
||||||
{
|
|
||||||
heBf[patchi] == he
|
|
||||||
(
|
|
||||||
this->T_.boundaryField()[patchi],
|
|
||||||
patchi
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
this->heBoundaryCorrection(he_);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class BasicThermo, class MixtureType>
|
template<class BasicThermo, class MixtureType>
|
||||||
template<class Method, class ... Args>
|
template<class Method, class ... Args>
|
||||||
Foam::tmp<Foam::volScalarField>
|
Foam::tmp<Foam::volScalarField>
|
||||||
@ -206,13 +178,12 @@ Foam::heThermo<BasicThermo, MixtureType>::heThermo
|
|||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
),
|
),
|
||||||
mesh,
|
he(this->p(), this->T_),
|
||||||
dimEnergy/dimMass,
|
|
||||||
this->heBoundaryTypes(),
|
this->heBoundaryTypes(),
|
||||||
this->heBoundaryBaseTypes()
|
this->heBoundaryBaseTypes()
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
init();
|
heBoundaryCorrection(he_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -240,13 +211,12 @@ Foam::heThermo<BasicThermo, MixtureType>::heThermo
|
|||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
),
|
),
|
||||||
mesh,
|
he(this->p(), this->T_),
|
||||||
dimEnergy/dimMass,
|
|
||||||
this->heBoundaryTypes(),
|
this->heBoundaryTypes(),
|
||||||
this->heBoundaryBaseTypes()
|
this->heBoundaryBaseTypes()
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
init();
|
heBoundaryCorrection(he_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -54,9 +54,6 @@ class heThermo
|
|||||||
{
|
{
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Initialize heThermo
|
|
||||||
void init();
|
|
||||||
|
|
||||||
//- Return a volScalarField of the given property
|
//- Return a volScalarField of the given property
|
||||||
template<class Method, class ... Args>
|
template<class Method, class ... Args>
|
||||||
tmp<volScalarField> volScalarFieldProperty
|
tmp<volScalarField> volScalarFieldProperty
|
||||||
|
|||||||
Reference in New Issue
Block a user