Commit c63f2f3c authored by mattijs's avatar mattijs
Browse files

Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

parents 871aa6a6 3d24f995
......@@ -502,14 +502,10 @@ template<class CloudType>
void Foam::KinematicCloud<CloudType>::setParcelThermoProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
const scalar lagrangianDt
)
{
if (!fullyDescribed)
{
parcel.rho() = constProps_.rho0();
}
parcel.rho() = constProps_.rho0();
}
......
......@@ -490,8 +490,7 @@ public:
void setParcelThermoProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
const scalar lagrangianDt
);
//- Check parcel properties
......
......@@ -225,20 +225,29 @@ Foam::ReactingCloud<CloudType>::~ReactingCloud()
template<class CloudType>
void Foam::ReactingCloud<CloudType>::setParcelThermoProperties
(
parcelType& parcel,
const scalar lagrangianDt
)
{
CloudType::setParcelThermoProperties(parcel, lagrangianDt);
parcel.pc() = this->thermo().thermo().p()[parcel.cell()];
parcel.Y() = composition().YMixture0();
}
template<class CloudType>
void Foam::ReactingCloud<CloudType>::checkParcelProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
)
{
CloudType::setParcelThermoProperties(parcel, lagrangianDt, fullyDescribed);
CloudType::checkParcelProperties(parcel, lagrangianDt, fullyDescribed);
if (!fullyDescribed)
{
parcel.pc() = this->thermo().thermo().p()[parcel.cell()];
parcel.Y() = composition().YMixture0();
}
else
if (fullyDescribed)
{
checkSuppliedComposition
(
......@@ -253,18 +262,6 @@ void Foam::ReactingCloud<CloudType>::setParcelThermoProperties
}
template<class CloudType>
void Foam::ReactingCloud<CloudType>::checkParcelProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
)
{
CloudType::checkParcelProperties(parcel, lagrangianDt, fullyDescribed);
}
template<class CloudType>
void Foam::ReactingCloud<CloudType>::storeState()
{
......
......@@ -271,8 +271,7 @@ public:
void setParcelThermoProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
const scalar lagrangianDt
);
//- Check parcel properties
......
......@@ -158,24 +158,37 @@ template<class CloudType>
void Foam::ReactingMultiphaseCloud<CloudType>::setParcelThermoProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
const scalar lagrangianDt
)
{
CloudType::setParcelThermoProperties(parcel, lagrangianDt, fullyDescribed);
CloudType::setParcelThermoProperties(parcel, lagrangianDt);
label idGas = this->composition().idGas();
label idLiquid = this->composition().idLiquid();
label idSolid = this->composition().idSolid();
if (!fullyDescribed)
{
parcel.YGas() = this->composition().Y0(idGas);
parcel.YLiquid() = this->composition().Y0(idLiquid);
parcel.YSolid() = this->composition().Y0(idSolid);
}
else
parcel.YGas() = this->composition().Y0(idGas);
parcel.YLiquid() = this->composition().Y0(idLiquid);
parcel.YSolid() = this->composition().Y0(idSolid);
}
template<class CloudType>
void Foam::ReactingMultiphaseCloud<CloudType>::checkParcelProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
)
{
CloudType::checkParcelProperties(parcel, lagrangianDt, fullyDescribed);
if (fullyDescribed)
{
label idGas = this->composition().idGas();
label idLiquid = this->composition().idLiquid();
label idSolid = this->composition().idSolid();
this->checkSuppliedComposition
(
parcel.YGas(),
......@@ -198,18 +211,6 @@ void Foam::ReactingMultiphaseCloud<CloudType>::setParcelThermoProperties
}
template<class CloudType>
void Foam::ReactingMultiphaseCloud<CloudType>::checkParcelProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
)
{
CloudType::checkParcelProperties(parcel, lagrangianDt, fullyDescribed);
}
template<class CloudType>
void Foam::ReactingMultiphaseCloud<CloudType>::storeState()
{
......
......@@ -244,8 +244,7 @@ public:
void setParcelThermoProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
const scalar lagrangianDt
);
//- Check parcel properties
......
......@@ -237,17 +237,13 @@ template<class CloudType>
void Foam::ThermoCloud<CloudType>::setParcelThermoProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
const scalar lagrangianDt
)
{
CloudType::setParcelThermoProperties(parcel, lagrangianDt, fullyDescribed);
CloudType::setParcelThermoProperties(parcel, lagrangianDt);
if (!fullyDescribed)
{
parcel.T() = constProps_.T0();
parcel.Cp() = constProps_.Cp0();
}
parcel.T() = constProps_.T0();
parcel.Cp() = constProps_.Cp0();
}
......
......@@ -285,8 +285,7 @@ public:
void setParcelThermoProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
const scalar lagrangianDt
);
//- Check parcel properties
......
......@@ -593,7 +593,7 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
);
// Check/set new parcel thermo properties
cloud.setParcelThermoProperties(*pPtr, dt, fullyDescribed());
cloud.setParcelThermoProperties(*pPtr, dt);
// Assign new parcel properties in injection model
setProperties(parcelI, newParcels, timeInj, *pPtr);
......@@ -702,7 +702,7 @@ void Foam::InjectionModel<CloudType>::injectSteadyState
);
// Check/set new parcel thermo properties
cloud.setParcelThermoProperties(*pPtr, 0.0, fullyDescribed());
cloud.setParcelThermoProperties(*pPtr, 0.0);
// Assign new parcel properties in injection model
setProperties(parcelI, newParcels, 0.0, *pPtr);
......
......@@ -161,23 +161,19 @@ template<class CloudType>
void Foam::SprayCloud<CloudType>::setParcelThermoProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
const scalar lagrangianDt
)
{
CloudType::setParcelThermoProperties(parcel, lagrangianDt, fullyDescribed);
CloudType::setParcelThermoProperties(parcel, lagrangianDt);
if (!fullyDescribed)
{
const liquidMixtureProperties& liqMix = this->composition().liquids();
const liquidMixtureProperties& liqMix = this->composition().liquids();
const scalarField& Y(parcel.Y());
scalarField X(liqMix.X(Y));
const scalarField& Y(parcel.Y());
scalarField X(liqMix.X(Y));
// override rho and Cp from constantProperties
parcel.Cp() = liqMix.Cp(parcel.pc(), parcel.T(), X);
parcel.rho() = liqMix.rho(parcel.pc(), parcel.T(), X);
}
// override rho and Cp from constantProperties
parcel.Cp() = liqMix.Cp(parcel.pc(), parcel.T(), X);
parcel.rho() = liqMix.rho(parcel.pc(), parcel.T(), X);
}
......
......@@ -213,8 +213,7 @@ public:
void setParcelThermoProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
const scalar lagrangianDt
);
//- Check parcel properties
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -47,7 +47,13 @@ template<int PolySize>
icoPolynomial<PolySize>::icoPolynomial(const dictionary& dict)
:
specie(dict),
rhoCoeffs_(dict.lookup("rhoCoeffs<" + Foam::name(PolySize) + '>'))
rhoCoeffs_
(
dict.subDict("equationOfState").lookup
(
"rhoCoeffs<" + Foam::name(PolySize) + '>'
)
)
{
rhoCoeffs_ *= this->W();
}
......@@ -59,8 +65,15 @@ template<int PolySize>
void icoPolynomial<PolySize>::write(Ostream& os) const
{
specie::write(os);
os.writeKeyword(word("rhoCoeffs<" + Foam::name(PolySize) + '>'))
<< rhoCoeffs_/this->W() << token::END_STATEMENT << nl;
dictionary dict("equationOfState");
dict.add
(
word("rhoCoeffs<" + Foam::name(PolySize) + '>'),
rhoCoeffs_/this->W()
);
os << dict;
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -40,10 +40,23 @@ Foam::incompressible::incompressible(Istream& is)
Foam::incompressible::incompressible(const dictionary& dict)
:
specie(dict),
rho_(readScalar(dict.lookup("rho")))
rho_(readScalar(dict.subDict("equationOfState").lookup("rho")))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::incompressible::write(Ostream& os) const
{
specie::write(os);
dictionary dict("equationOfState");
dict.add("rho", rho_);
os << dict;
}
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Ostream& os, const incompressible& ico)
......@@ -51,7 +64,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const incompressible& ico)
os << static_cast<const specie&>(ico)
<< token::SPACE << ico.rho_;
os.check("Ostream& operator<<(Ostream& os, const incompressible& st)");
os.check("Ostream& operator<<(Ostream& os, const incompressible& ico)");
return os;
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -83,14 +83,22 @@ public:
// Member functions
//- Return density [kg/m^3]
inline scalar rho(scalar p, scalar T) const;
// Fundamental properties
//- Return compressibility rho/p [s^2/m^2]
inline scalar psi(scalar p, scalar T) const;
//- Return density [kg/m^3]
inline scalar rho(scalar p, scalar T) const;
//- Return compression factor []
inline scalar Z(scalar p, scalar T) const;
//- Return compressibility rho/p [s^2/m^2]
inline scalar psi(scalar p, scalar T) const;
//- Return compression factor []
inline scalar Z(scalar p, scalar T) const;
// I-O
//- Write to Ostream
void write(Ostream& os) const;
// Member operators
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -54,8 +54,8 @@ Foam::specie::specie(Istream& is)
Foam::specie::specie(const dictionary& dict)
:
name_(dict.dictName()),
nMoles_(readScalar(dict.lookup("nMoles"))),
molWeight_(readScalar(dict.lookup("molWeight")))
nMoles_(readScalar(dict.subDict("specie").lookup("nMoles"))),
molWeight_(readScalar(dict.subDict("specie").lookup("molWeight")))
{}
......@@ -63,8 +63,10 @@ Foam::specie::specie(const dictionary& dict)
void Foam::specie::write(Ostream& os) const
{
os.writeKeyword("nMoles") << nMoles_ << token::END_STATEMENT << nl;
os.writeKeyword("molWeight") << molWeight_ << token::END_STATEMENT << nl;
dictionary dict("specie");
dict.add("nMoles", nMoles_);
dict.add("molWeight", molWeight_);
os << dict;
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -43,8 +43,8 @@ template<class EquationOfState>
Foam::eConstThermo<EquationOfState>::eConstThermo(const dictionary& dict)
:
EquationOfState(dict),
Cv_(readScalar(dict.lookup("Cv"))),
Hf_(readScalar(dict.lookup("Hf")))
Cv_(readScalar(dict.subDict("thermodynamics").lookup("Cv"))),
Hf_(readScalar(dict.subDict("thermodynamics").lookup("Hf")))
{}
......@@ -54,8 +54,11 @@ template<class EquationOfState>
void Foam::eConstThermo<EquationOfState>::write(Ostream& os) const
{
EquationOfState::write(os);
os.writeKeyword("Cv") << Cv_ << token::END_STATEMENT << nl;
os.writeKeyword("Hf") << Hf_ << token::END_STATEMENT << nl;
dictionary dict("thermodynamics");
dict.add("Cv", Cv_);
dict.add("Hf", Hf_);
os << dict;
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -43,8 +43,8 @@ template<class equationOfState>
Foam::hConstThermo<equationOfState>::hConstThermo(const dictionary& dict)
:
equationOfState(dict),
Cp_(readScalar(dict.lookup("Cp"))),
Hf_(readScalar(dict.lookup("Hf")))
Cp_(readScalar(dict.subDict("thermodynamics").lookup("Cp"))),
Hf_(readScalar(dict.subDict("thermodynamics").lookup("Hf")))
{}
......@@ -54,8 +54,11 @@ template<class equationOfState>
void Foam::hConstThermo<equationOfState>::write(Ostream& os) const
{
equationOfState::write(os);
os.writeKeyword("Cp") << Cp_ << token::END_STATEMENT << nl;
os.writeKeyword("Hf") << Hf_ << token::END_STATEMENT << nl;
dictionary dict("thermodynamics");
dict.add("Cp", Cp_);
dict.add("Hf", Hf_);
os << dict;
}
......
......@@ -63,9 +63,15 @@ Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo
)
:
EquationOfState(dict),
Hf_(readScalar(dict.lookup("Hf"))),
Sf_(readScalar(dict.lookup("Sf"))),
CpCoeffs_(dict.lookup("CpCoeffs<" + Foam::name(PolySize) + '>')),
Hf_(readScalar(dict.subDict("thermodynamics").lookup("Hf"))),
Sf_(readScalar(dict.subDict("thermodynamics").lookup("Sf"))),
CpCoeffs_
(
dict.subDict("thermodynamics").lookup
(
"CpCoeffs<" + Foam::name(PolySize) + '>'
)
),
hCoeffs_(),
sCoeffs_()
{
......@@ -93,10 +99,16 @@ void Foam::hPolynomialThermo<EquationOfState, PolySize>::write
) const
{
EquationOfState::write(os);
os.writeKeyword("Hf") << Hf_/this->W() << token::END_STATEMENT << nl;
os.writeKeyword("Sf") << Sf_/this->W() << token::END_STATEMENT << nl;
os.writeKeyword(word("CpCoeffs<" + Foam::name(PolySize) + '>'))
<< CpCoeffs_/this->W() << token::END_STATEMENT << nl;
dictionary dict("thermodynamics");
dict.add("Hf", Hf_);
dict.add("Sf", Sf_);
dict.add
(
word("CpCoeffs<" + Foam::name(PolySize) + '>'),
CpCoeffs_/this->W()
);
os << dict;
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -85,11 +85,11 @@ template<class EquationOfState>
Foam::janafThermo<EquationOfState>::janafThermo(const dictionary& dict)
:
EquationOfState(dict),
Tlow_(readScalar(dict.lookup("Tlow"))),
Thigh_(readScalar(dict.lookup("Thigh"))),
Tcommon_(readScalar(dict.lookup("Tcommon"))),
highCpCoeffs_(dict.lookup("highCpCoeffs")),
lowCpCoeffs_(dict.lookup("lowCpCoeffs"))
Tlow_(readScalar(dict.subDict("thermodynamics").lookup("Tlow"))),
Thigh_(readScalar(dict.subDict("thermodynamics").lookup("Thigh"))),
Tcommon_(readScalar(dict.subDict("thermodynamics").lookup("Tcommon"))),
highCpCoeffs_(dict.subDict("thermodynamics").lookup("highCpCoeffs")),
lowCpCoeffs_(dict.subDict("thermodynamics").lookup("lowCpCoeffs"))
{
checkInputData();
}
......@@ -101,13 +101,14 @@ template<class EquationOfState>
void Foam::janafThermo<EquationOfState>::write(Ostream& os) const
{
EquationOfState::write(os);
os.writeKeyword("Tlow") << Tlow_ << token::END_STATEMENT << endl;
os.writeKeyword("Thigh") << Thigh_ << token::END_STATEMENT << endl;
os.writeKeyword("Tcommon") << Tcommon_ << token::END_STATEMENT << endl;
os.writeKeyword("highCpCoeffs") << highCpCoeffs_ << token::END_STATEMENT
<< endl;
os.writeKeyword("lowCpCoeffs") << lowCpCoeffs_ << token::END_STATEMENT
<< endl;
dictionary dict("thermodynamics");
dict.add("Tlow", Tlow_);
dict.add("Thigh", Thigh_);
dict.add("Tcommon", Tcommon_);
dict.add("highCpCoeffs", highCpCoeffs_);
dict.add("lowCpCoeffs", lowCpCoeffs_);
os << dict;
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox