ENH: Up to date icoReactingMultiphaseInterFoam solver and libs

Adding tutorials and other minor changes
This commit is contained in:
sergio
2018-06-04 11:25:59 -07:00
committed by Andrew Heather
parent d68adc4d31
commit 4cb073e150
173 changed files with 6434 additions and 5219 deletions

View File

@ -95,18 +95,7 @@ Foam::tmp<Foam::Field<Type>> Foam::Function1Types::Constant<Type>::value
template<class Type>
<<<<<<< HEAD
Foam::tmp<Foam::Field<Type>> Foam::Function1Types::Constant<Type>::integrate
=======
bool Foam::Function1Types::Constant<Type>::isConstant() const
{
return true;
}
template<class Type>
Type Foam::Function1Types::Constant<Type>::integrate
>>>>>>> c61dc5e... ENH: adding thermo changes to handle multiphase T based thermos
(
const scalarField& x1,
const scalarField& x2

View File

@ -121,9 +121,6 @@ public:
const scalarField& x2
) const;
//- Return true for Constant type
virtual bool isConstant() const;
//- Write in dictionary format
virtual void writeData(Ostream& os) const;
};

View File

@ -157,13 +157,6 @@ Foam::FieldFunction1<Function1Type>::integrate
}
template<class Type>
bool Foam::Function1<Type>::isConstant() const
{
return false;
}
template<class Type>
void Foam::Function1<Type>::writeData(Ostream& os) const
{

View File

@ -154,9 +154,6 @@ public:
const scalarField& x2
) const;
//- Return true for Constant type
virtual bool isConstant() const;
// I/O

View File

@ -119,12 +119,6 @@ Type Foam::TimeFunction1<Type>::integrate
}
template<class Type>
bool Foam::TimeFunction1<Type>::isConstant() const
{
return entry_->isConstant();
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class Type>

View File

@ -121,8 +121,6 @@ public:
//- Integrate between two (scalar) values
virtual Type integrate(const scalar x1, const scalar x2) const;
//- Return true for Constant type
virtual bool isConstant() const;
// I/O

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -89,8 +89,7 @@ Foam::tabulated6DoFAcceleration::acceleration() const
values_
);
InfoInFunction
<< "Time = " << t << " accelerations: " << avs << endl;
Info << "Time = " << t << " accelerations: " << avs << endl;
return avs;
}

View File

@ -90,49 +90,9 @@ void Foam::heThermo<BasicThermo, MixtureType>::init
}
}
/*
template<class BasicThermo, class MixtureType>
Foam::volScalarField& Foam::heThermo<BasicThermo, MixtureType>::lookupOrConstruct
(
const fvMesh& mesh,
const word& name
)
{
if (!mesh.objectRegistry::foundObject<volScalarField>(name))
{
volScalarField* fPtr
(
new volScalarField
(
IOobject
(
name,
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimEnergy/dimMass,
this->heBoundaryTypes(),
this->heBoundaryBaseTypes()
)
);
// Transfer ownership of this object to the objectRegistry
fPtr->store(fPtr);
}
return const_cast<volScalarField&>
(
mesh.objectRegistry::lookupObject<volScalarField>(name)
);
}
*/
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class BasicThermo, class MixtureType>
Foam::heThermo<BasicThermo, MixtureType>::heThermo
(
@ -161,19 +121,6 @@ Foam::heThermo<BasicThermo, MixtureType>::heThermo
this->heBoundaryTypes(),
this->heBoundaryBaseTypes()
)
/*
he_
(
this->lookupOrConstruct
(
mesh,
BasicThermo::phasePropertyName
(
MixtureType::thermoType::heName()
)
)
)
*/
{
init(this->p_, this->T_, he_);
}
@ -208,18 +155,8 @@ Foam::heThermo<BasicThermo, MixtureType>::heThermo
this->heBoundaryTypes(),
this->heBoundaryBaseTypes()
)
/*
he_
(
this->lookupOrConstruct
(
mesh,
MixtureType::thermoType::heName()
)
)
*/
{
init();
init(this->p_, this->T_, he_);
}
@ -252,19 +189,6 @@ Foam::heThermo<BasicThermo, MixtureType>::heThermo
this->heBoundaryTypes(),
this->heBoundaryBaseTypes()
)
/*
he_
(
this->lookupOrConstruct
(
mesh,
BasicThermo::phasePropertyName
(
MixtureType::thermoType::heName()
)
)
)
*/
{
init(this->p_, this->T_, he_);
}

View File

@ -84,13 +84,6 @@ private:
volScalarField& he
);
//- Lookup or construct he
// volScalarField& lookupOrConstruct
// (
// const fvMesh& mesh,
// const word& name
// );
public:

View File

@ -134,71 +134,6 @@ void Foam::hePsiThermo<BasicPsiThermo, MixtureType>::calculate
}
}
/*
template<class BasicPsiThermo, class MixtureType>
void Foam::hePsiThermo<BasicPsiThermo, MixtureType>::calculateT()
{
const scalarField& pCells = this->p_.primitiveFieldRef();
scalarField& TCells = this->T_.primitiveFieldRef();
scalarField& psiCells = this->psi_.primitiveFieldRef();
scalarField& muCells = this->mu_.primitiveFieldRef();
scalarField& alphaCells = this->alpha_.primitiveFieldRef();
forAll(TCells, celli)
{
const typename MixtureType::thermoType& mixture_ =
this->cellMixture(celli);
psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]);
muCells[celli] = mixture_.mu(pCells[celli], TCells[celli]);
alphaCells[celli] = mixture_.alphah(pCells[celli], TCells[celli]);
}
forAll(this->T_.boundaryField(), patchi)
{
fvPatchScalarField& pp = this->p_.boundaryFieldRef()[patchi];
fvPatchScalarField& pT = this->T_.boundaryFieldRef()[patchi];
fvPatchScalarField& ppsi = this->psi_.boundaryFieldRef()[patchi];
fvPatchScalarField& ph = this->he_.boundaryFieldRef()[patchi];
fvPatchScalarField& pmu = this->mu_.boundaryFieldRef()[patchi];
fvPatchScalarField& palpha = this->alpha_.boundaryFieldRef()[patchi];
if (pT.fixesValue())
{
forAll(pT, facei)
{
const typename MixtureType::thermoType& mixture_ =
this->patchFaceMixture(patchi, facei);
ph[facei] = mixture_.HE(pp[facei], pT[facei]);
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
pmu[facei] = mixture_.mu(pp[facei], pT[facei]);
palpha[facei] = mixture_.alphah(pp[facei], pT[facei]);
}
}
else
{
forAll(pT, facei)
{
const typename MixtureType::thermoType& mixture_ =
this->patchFaceMixture(patchi, facei);
//pT[facei] = mixture_.THE(ph[facei], pp[facei], pT[facei]);
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
pmu[facei] = mixture_.mu(pp[facei], pT[facei]);
palpha[facei] = mixture_.alphah(pp[facei], pT[facei]);
}
}
}
}
*/
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class BasicPsiThermo, class MixtureType>
@ -233,10 +168,16 @@ Foam::hePsiThermo<BasicPsiThermo, MixtureType>::hePsiThermo
:
heThermo<BasicPsiThermo, MixtureType>(mesh, phaseName, dictionaryName)
{
calculate();
// Switch on saving old time
this->psi_.oldTime();
calculate
(
this->p_,
this->T_,
this->he_,
this->psi_,
this->mu_,
this->alpha_,
true // Create old time fields
);
}
@ -269,14 +210,4 @@ void Foam::hePsiThermo<BasicPsiThermo, MixtureType>::correct()
DebugInFunction << "Finished" << endl;
}
/*
template<class BasicPsiThermo, class MixtureType>
void Foam::hePsiThermo<BasicPsiThermo, MixtureType>::correctT()
{
// force the saving of the old-time values
this->psi_.oldTime();
calculateT();
}
*/
// ************************************************************************* //

View File

@ -106,9 +106,6 @@ public:
//- Update properties
virtual void correct();
//- Update properties from T
//virtual void correctT();
};

View File

@ -142,83 +142,6 @@ void Foam::heRhoThermo<BasicPsiThermo, MixtureType>::calculate
}
}
/*
template<class BasicPsiThermo, class MixtureType>
void Foam::heRhoThermo<BasicPsiThermo, MixtureType>::calculateT()
{
//const scalarField& hCells = this->he().internalField();
const scalarField& pCells = this->p_.primitiveFieldRef();
scalarField& TCells = this->T_.primitiveFieldRef();
scalarField& psiCells = this->psi_.primitiveFieldRef();
scalarField& rhoCells = this->rho_.primitiveFieldRef();
scalarField& muCells = this->mu_.primitiveFieldRef();
scalarField& alphaCells = this->alpha_.primitiveFieldRef();
forAll(TCells, celli)
{
const typename MixtureType::thermoType& mixture_ =
this->cellMixture(celli);
// TCells[celli] = mixture_.THE
// (
// hCells[celli],
// pCells[celli],
// TCells[celli]
// );
psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]);
rhoCells[celli] = mixture_.rho(pCells[celli], TCells[celli]);
muCells[celli] = mixture_.mu(pCells[celli], TCells[celli]);
alphaCells[celli] = mixture_.alphah(pCells[celli], TCells[celli]);
}
forAll(this->T_.boundaryField(), patchi)
{
fvPatchScalarField& pp = this->p_.boundaryFieldRef()[patchi];
fvPatchScalarField& pT = this->T_.boundaryFieldRef()[patchi];
fvPatchScalarField& ppsi = this->psi_.boundaryFieldRef()[patchi];
fvPatchScalarField& prho = this->rho_.boundaryFieldRef()[patchi];
//fvPatchScalarField& ph = this->he().boundaryField()[patchi];
fvPatchScalarField& pmu = this->mu_.boundaryFieldRef()[patchi];
fvPatchScalarField& palpha = this->alpha_.boundaryFieldRef()[patchi];
if (pT.fixesValue())
{
forAll(pT, facei)
{
const typename MixtureType::thermoType& mixture_ =
this->patchFaceMixture(patchi, facei);
//ph[facei] = mixture_.HE(pp[facei], pT[facei]);
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
prho[facei] = mixture_.rho(pp[facei], pT[facei]);
pmu[facei] = mixture_.mu(pp[facei], pT[facei]);
palpha[facei] = mixture_.alphah(pp[facei], pT[facei]);
}
}
else
{
forAll(pT, facei)
{
const typename MixtureType::thermoType& mixture_ =
this->patchFaceMixture(patchi, facei);
//pT[facei] = mixture_.THE(ph[facei], pp[facei], pT[facei]);
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
prho[facei] = mixture_.rho(pp[facei], pT[facei]);
pmu[facei] = mixture_.mu(pp[facei], pT[facei]);
palpha[facei] = mixture_.alphah(pp[facei], pT[facei]);
}
}
}
}
*/
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class BasicPsiThermo, class MixtureType>
@ -254,7 +177,17 @@ Foam::heRhoThermo<BasicPsiThermo, MixtureType>::heRhoThermo
:
heThermo<BasicPsiThermo, MixtureType>(mesh, phaseName, dictName)
{
calculate();
calculate
(
this->p_,
this->T_,
this->he_,
this->psi_,
this->rho_,
this->mu_,
this->alpha_,
true // Create old time fields
);
}
@ -286,22 +219,5 @@ void Foam::heRhoThermo<BasicPsiThermo, MixtureType>::correct()
DebugInFunction << "Finished" << endl;
}
/*
template<class BasicPsiThermo, class MixtureType>
void Foam::heRhoThermo<BasicPsiThermo, MixtureType>::correctT()
{
if (debug)
{
InfoInFunction << endl;
}
calculateT();
if (debug)
{
Info<< " Finished" << endl;
}
}
*/
// ************************************************************************* //

View File

@ -279,6 +279,19 @@ Foam::tmp<Foam::fvScalarMatrix> Foam::radiation::radiationModel::ST
}
Foam::tmp<Foam::fvScalarMatrix> Foam::radiation::radiationModel::ST
(
volScalarField& T
) const
{
return
(
Ru()
- fvm::Sp(Rp()*pow3(T), T)
);
}
const Foam::radiation::absorptionEmissionModel&
Foam::radiation::radiationModel::absorptionEmission() const
{

View File

@ -257,6 +257,12 @@ public:
volScalarField& T
) const;
//- Temperature source term
virtual tmp<fvScalarMatrix> ST
(
volScalarField& T
) const;
//- Access to absorptionEmission model
const absorptionEmissionModel& absorptionEmission() const;

View File

@ -56,9 +56,6 @@ class heSolidThermo
//- Calculate the thermo variables
void calculate();
//- Calculate the thermo variables based on T
void calculateT();
//- Construct as copy (not implemented)
heSolidThermo(const heSolidThermo<BasicSolidThermo, MixtureType>&);
@ -104,9 +101,6 @@ public:
//- Update properties
virtual void correct();
//- Update properties from T
//virtual void correctT();
// Derived thermal properties