diff --git a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.C b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.C index 5935b101026320df399f1cc2f6c52101d425502b..a227493a65e92828d9f2688481a6c82387d69ede 100644 --- a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.C +++ b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.C @@ -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; } diff --git a/src/thermophysicalModels/specie/equationOfState/incompressible/incompressible.C b/src/thermophysicalModels/specie/equationOfState/incompressible/incompressible.C index 1a9fb0024d94629dd46b449aff33d870796a4792..4174ddfa977695c2688616564ad61c77e1af989c 100644 --- a/src/thermophysicalModels/specie/equationOfState/incompressible/incompressible.C +++ b/src/thermophysicalModels/specie/equationOfState/incompressible/incompressible.C @@ -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; } diff --git a/src/thermophysicalModels/specie/equationOfState/incompressible/incompressible.H b/src/thermophysicalModels/specie/equationOfState/incompressible/incompressible.H index 36cf8a412404769b6f3bbbb91e547a2fbda59dff..4d6c8c4ff36ebd7e2b81620b6dc48f946dab99ec 100644 --- a/src/thermophysicalModels/specie/equationOfState/incompressible/incompressible.H +++ b/src/thermophysicalModels/specie/equationOfState/incompressible/incompressible.H @@ -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 diff --git a/src/thermophysicalModels/specie/specie/specie.C b/src/thermophysicalModels/specie/specie/specie.C index ac9f41fbeb54d53564dfea10c7574776c309a637..cfd925ab19b6119338437624b527ca1ed59f1436 100644 --- a/src/thermophysicalModels/specie/specie/specie.C +++ b/src/thermophysicalModels/specie/specie/specie.C @@ -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; } diff --git a/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.C b/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.C index bb56c38afa49c777d18219cc2bafa9475030bb4a..a89059c52b6576b5b1924e63f9826f2ba294ed95 100644 --- a/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.C +++ b/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.C @@ -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; } diff --git a/src/thermophysicalModels/specie/thermo/hConst/hConstThermo.C b/src/thermophysicalModels/specie/thermo/hConst/hConstThermo.C index ca35a0470cd16492c29551900121fdd4c30f7dd8..3f1b831e03b8711cdf4fe00dcb500df6d1f8b775 100644 --- a/src/thermophysicalModels/specie/thermo/hConst/hConstThermo.C +++ b/src/thermophysicalModels/specie/thermo/hConst/hConstThermo.C @@ -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; } diff --git a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.C b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.C index c86db56ae7ffa2c8d03d9a7ec38af2728679ea92..10d1a280b3c422013443cdbfdfb0fa357b6737cc 100644 --- a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.C +++ b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.C @@ -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; } diff --git a/src/thermophysicalModels/specie/thermo/janaf/janafThermo.C b/src/thermophysicalModels/specie/thermo/janaf/janafThermo.C index cb01544d146c9c0bc381582dbf99c71be0eb97e7..895a886ca6a5df33b2a907dca8ecf99655089c83 100644 --- a/src/thermophysicalModels/specie/thermo/janaf/janafThermo.C +++ b/src/thermophysicalModels/specie/thermo/janaf/janafThermo.C @@ -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; } diff --git a/src/thermophysicalModels/specie/transport/const/constTransport.C b/src/thermophysicalModels/specie/transport/const/constTransport.C index a5564c712b116f976e5a90d58bb20840576c3a70..c6e028db308eee9d92f524595b84fc5dc7f212fb 100644 --- a/src/thermophysicalModels/specie/transport/const/constTransport.C +++ b/src/thermophysicalModels/specie/transport/const/constTransport.C @@ -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 Thermo> Foam::constTransport<Thermo>::constTransport(const dictionary& dict) : Thermo(dict), - mu_(readScalar(dict.lookup("mu"))), - rPr_(1.0/readScalar(dict.lookup("Pr"))) + mu_(readScalar(dict.subDict("transport").lookup("mu"))), + rPr_(1.0/readScalar(dict.subDict("transport").lookup("Pr"))) {} @@ -55,9 +55,14 @@ void Foam::constTransport<Thermo>::constTransport::write(Ostream& os) const { os << this->name() << endl; os << token::BEGIN_BLOCK << incrIndent << nl; + Thermo::write(os); - os.writeKeyword("mu") << mu_ << token::END_STATEMENT << nl; - os.writeKeyword("Pr") << 1.0/rPr_ << token::END_STATEMENT << nl; + + dictionary dict("transport"); + dict.add("mu", mu_); + dict.add("Pr", 1.0/rPr_); + os << dict; + os << decrIndent << token::END_BLOCK << nl; } diff --git a/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.C b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.C index 99b3e1ebdfd2856ee7bc8ce3861d333429b0b33f..f7e823160db72a1c48539484329a32be16d7e5c7 100644 --- a/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.C +++ b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.C @@ -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,8 +47,20 @@ Foam::polynomialTransport<Thermo, PolySize>::polynomialTransport ) : Thermo(dict), - muCoeffs_(dict.lookup("muCoeffs<" + Foam::name(PolySize) + '>')), - kappaCoeffs_(dict.lookup("kappaCoeffs<" + Foam::name(PolySize) + '>')) + muCoeffs_ + ( + dict.subDict("transport").lookup + ( + "muCoeffs<" + Foam::name(PolySize) + '>' + ) + ), + kappaCoeffs_ + ( + dict.subDict("transport").lookup + ( + "kappaCoeffs<" + Foam::name(PolySize) + '>' + ) + ) { muCoeffs_ *= this->W(); kappaCoeffs_ *= this->W(); @@ -62,11 +74,22 @@ void Foam::polynomialTransport<Thermo, PolySize>::write(Ostream& os) const { os << this->name() << endl; os << token::BEGIN_BLOCK << incrIndent << nl; + Thermo::write(os); - os.writeKeyword(word("muCoeffs<" + Foam::name(PolySize) + '>')) - << muCoeffs_/this->W() << token::END_STATEMENT << nl; - os.writeKeyword(word("kappaCoeffs<" + Foam::name(PolySize) + '>')) - << kappaCoeffs_/this->W() << token::END_STATEMENT << nl; + + dictionary dict("transport"); + dict.add + ( + word("muCoeffs<" + Foam::name(PolySize) + '>'), + muCoeffs_/this->W() + ); + dict.add + ( + word("kappaCoeffs<" + Foam::name(PolySize) + '>'), + kappaCoeffs_/this->W() + ); + os << dict; + os << decrIndent << token::END_BLOCK << nl; } diff --git a/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransport.C b/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransport.C index 73936afc3a4713f007137b6d0d0ab44205a5961a..ad0ea57d2b4aca82839aff457895fe4c5ffd52b1 100644 --- a/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransport.C +++ b/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransport.C @@ -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 Thermo> Foam::sutherlandTransport<Thermo>::sutherlandTransport(const dictionary& dict) : Thermo(dict), - As_(readScalar(dict.lookup("As"))), - Ts_(readScalar(dict.lookup("Ts"))) + As_(readScalar(dict.subDict("transport").lookup("As"))), + Ts_(readScalar(dict.subDict("transport").lookup("Ts"))) {} @@ -55,9 +55,14 @@ void Foam::sutherlandTransport<Thermo>::write(Ostream& os) const { os << this->name() << endl; os << token::BEGIN_BLOCK << incrIndent << nl; + Thermo::write(os); - os.writeKeyword("As") << As_ << token::END_STATEMENT << nl; - os.writeKeyword("Ts") << Ts_ << token::END_STATEMENT << nl; + + dictionary dict("transport"); + dict.add("As", As_); + dict.add("Ts", Ts_); + os << dict; + os << decrIndent << token::END_BLOCK << nl; }