From 5bc064c165a42992a70c0f1dc66381b7b16c505f Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 17 Feb 2017 20:29:58 +0000 Subject: [PATCH] liquidProperties: simplified and generalized the IO When liquids are constructed from dictionary the coefficients are now first initialized to their standard values and overridden by the now optional entries provided in the dictionary. For example to specify water with all the standard temperature varying properties but override only the density with a constant value of 1000 specify in thermophysicalProperties liquids { H2O { defaultCoeffs no; H2OCoeffs { rho { a 1000; b 0; c 0; d 0; } } } } --- .../properties/liquidProperties/Ar/Ar.C | 36 ++++++----- .../properties/liquidProperties/Ar/Ar.H | 29 +++------ .../liquidProperties/C10H22/C10H22.C | 36 ++++++----- .../liquidProperties/C10H22/C10H22.H | 30 +++------ .../liquidProperties/C12H26/C12H26.C | 36 ++++++----- .../liquidProperties/C12H26/C12H26.H | 29 +++------ .../liquidProperties/C13H28/C13H28.C | 36 ++++++----- .../liquidProperties/C13H28/C13H28.H | 29 +++------ .../liquidProperties/C14H30/C14H30.C | 36 ++++++----- .../liquidProperties/C14H30/C14H30.H | 29 +++------ .../liquidProperties/C16H34/C16H34.C | 36 ++++++----- .../liquidProperties/C16H34/C16H34.H | 29 +++------ .../liquidProperties/C2H5OH/C2H5OH.C | 36 ++++++----- .../liquidProperties/C2H5OH/C2H5OH.H | 29 +++------ .../properties/liquidProperties/C2H6/C2H6.C | 36 ++++++----- .../properties/liquidProperties/C2H6/C2H6.H | 29 +++------ .../properties/liquidProperties/C2H6O/C2H6O.C | 36 ++++++----- .../properties/liquidProperties/C2H6O/C2H6O.H | 29 +++------ .../properties/liquidProperties/C3H6O/C3H6O.C | 36 ++++++----- .../properties/liquidProperties/C3H6O/C3H6O.H | 30 +++------ .../properties/liquidProperties/C3H8/C3H8.C | 36 ++++++----- .../properties/liquidProperties/C3H8/C3H8.H | 29 +++------ .../liquidProperties/C4H10O/C4H10O.C | 36 ++++++----- .../liquidProperties/C4H10O/C4H10O.H | 29 +++------ .../properties/liquidProperties/C6H14/C6H14.C | 36 ++++++----- .../properties/liquidProperties/C6H14/C6H14.H | 29 +++------ .../properties/liquidProperties/C6H6/C6H6.C | 36 ++++++----- .../properties/liquidProperties/C6H6/C6H6.H | 29 +++------ .../properties/liquidProperties/C7H16/C7H16.C | 36 ++++++----- .../properties/liquidProperties/C7H16/C7H16.H | 29 +++------ .../properties/liquidProperties/C7H8/C7H8.C | 36 ++++++----- .../properties/liquidProperties/C7H8/C7H8.H | 29 +++------ .../properties/liquidProperties/C8H10/C8H10.C | 36 ++++++----- .../properties/liquidProperties/C8H10/C8H10.H | 29 +++------ .../properties/liquidProperties/C8H18/C8H18.C | 36 ++++++----- .../properties/liquidProperties/C8H18/C8H18.H | 29 +++------ .../properties/liquidProperties/C9H20/C9H20.C | 36 ++++++----- .../properties/liquidProperties/C9H20/C9H20.H | 29 +++------ .../properties/liquidProperties/CH3OH/CH3OH.C | 36 ++++++----- .../properties/liquidProperties/CH3OH/CH3OH.H | 29 +++------ .../liquidProperties/CH4N2O/CH4N2O.C | 36 ++++++----- .../liquidProperties/CH4N2O/CH4N2O.H | 29 +++------ .../properties/liquidProperties/H2O/H2O.C | 37 ++++++----- .../properties/liquidProperties/H2O/H2O.H | 29 +++------ .../liquidProperties/IC8H18/IC8H18.C | 36 ++++++----- .../liquidProperties/IC8H18/IC8H18.H | 29 +++------ .../properties/liquidProperties/IDEA/IDEA.C | 36 ++++++----- .../properties/liquidProperties/IDEA/IDEA.H | 28 +++------ .../properties/liquidProperties/MB/MB.C | 36 ++++++----- .../properties/liquidProperties/MB/MB.H | 29 +++------ .../properties/liquidProperties/N2/N2.C | 36 ++++++----- .../properties/liquidProperties/N2/N2.H | 29 +++------ .../liquidProperties/aC10H7CH3/aC10H7CH3.C | 36 ++++++----- .../liquidProperties/aC10H7CH3/aC10H7CH3.H | 30 +++------ .../liquidProperties/bC10H7CH3/bC10H7CH3.C | 36 ++++++----- .../liquidProperties/bC10H7CH3/bC10H7CH3.H | 29 +++------ .../liquidProperties/iC3H8O/iC3H8O.C | 36 ++++++----- .../liquidProperties/iC3H8O/iC3H8O.H | 29 +++------ .../liquidProperties/liquidProperties.C | 25 ++++++++ .../liquidProperties/liquidProperties.H | 39 ++++++++++-- .../liquidProperties/liquidPropertiesI.H | 63 +++++++++++++++++++ .../liquidProperties/nC3H8O/nC3H8O.C | 36 ++++++----- .../liquidProperties/nC3H8O/nC3H8O.H | 29 +++------ 63 files changed, 959 insertions(+), 1121 deletions(-) diff --git a/src/thermophysicalModels/properties/liquidProperties/Ar/Ar.C b/src/thermophysicalModels/properties/liquidProperties/Ar/Ar.C index c6bcfbdc1..a9f1b61bf 100644 --- a/src/thermophysicalModels/properties/liquidProperties/Ar/Ar.C +++ b/src/thermophysicalModels/properties/liquidProperties/Ar/Ar.C @@ -121,21 +121,27 @@ Foam::Ar::Ar Foam::Ar::Ar(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + Ar() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::Ar::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const Ar& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/Ar/Ar.H b/src/thermophysicalModels/properties/liquidProperties/Ar/Ar.H index f5710401d..a84320b96 100644 --- a/src/thermophysicalModels/properties/liquidProperties/Ar/Ar.H +++ b/src/thermophysicalModels/properties/liquidProperties/Ar/Ar.H @@ -79,6 +79,8 @@ class Ar public: + friend class liquidProperties; + //- Runtime type information TypeName("Ar"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const Ar& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const Ar& l); }; +Ostream& operator<<(Ostream& os, const Ar& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/C10H22/C10H22.C b/src/thermophysicalModels/properties/liquidProperties/C10H22/C10H22.C index 5d82ef6da..14937565f 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C10H22/C10H22.C +++ b/src/thermophysicalModels/properties/liquidProperties/C10H22/C10H22.C @@ -129,21 +129,27 @@ Foam::C10H22::C10H22 Foam::C10H22::C10H22(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + C10H22() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::C10H22::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const C10H22& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/C10H22/C10H22.H b/src/thermophysicalModels/properties/liquidProperties/C10H22/C10H22.H index 2f747a27b..216acbf15 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C10H22/C10H22.H +++ b/src/thermophysicalModels/properties/liquidProperties/C10H22/C10H22.H @@ -79,6 +79,8 @@ class C10H22 public: + friend class liquidProperties; + //- Runtime type information TypeName("C10H22"); @@ -165,34 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } - + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const C10H22& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const C10H22& l); }; +Ostream& operator<<(Ostream& os, const C10H22& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/C12H26/C12H26.C b/src/thermophysicalModels/properties/liquidProperties/C12H26/C12H26.C index 3f5271210..9dbc1dcee 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C12H26/C12H26.C +++ b/src/thermophysicalModels/properties/liquidProperties/C12H26/C12H26.C @@ -121,21 +121,27 @@ Foam::C12H26::C12H26 Foam::C12H26::C12H26(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + C12H26() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::C12H26::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const C12H26& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/C12H26/C12H26.H b/src/thermophysicalModels/properties/liquidProperties/C12H26/C12H26.H index 23c1ad907..e50af5035 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C12H26/C12H26.H +++ b/src/thermophysicalModels/properties/liquidProperties/C12H26/C12H26.H @@ -79,6 +79,8 @@ class C12H26 public: + friend class liquidProperties; + //- Runtime type information TypeName("C12H26"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const C12H26& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const C12H26& l); }; +Ostream& operator<<(Ostream& os, const C12H26& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/C13H28/C13H28.C b/src/thermophysicalModels/properties/liquidProperties/C13H28/C13H28.C index a4011182a..8c046e73e 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C13H28/C13H28.C +++ b/src/thermophysicalModels/properties/liquidProperties/C13H28/C13H28.C @@ -129,21 +129,27 @@ Foam::C13H28::C13H28 Foam::C13H28::C13H28(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + C13H28() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::C13H28::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const C13H28& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/C13H28/C13H28.H b/src/thermophysicalModels/properties/liquidProperties/C13H28/C13H28.H index 4ed22aafe..c8ebfdfdb 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C13H28/C13H28.H +++ b/src/thermophysicalModels/properties/liquidProperties/C13H28/C13H28.H @@ -79,6 +79,8 @@ class C13H28 public: + friend class liquidProperties; + //- Runtime type information TypeName("C13H28"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const C13H28& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const C13H28& l); }; +Ostream& operator<<(Ostream& os, const C13H28& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/C14H30/C14H30.C b/src/thermophysicalModels/properties/liquidProperties/C14H30/C14H30.C index 98fbbc8f7..63533f8ae 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C14H30/C14H30.C +++ b/src/thermophysicalModels/properties/liquidProperties/C14H30/C14H30.C @@ -129,21 +129,27 @@ Foam::C14H30::C14H30 Foam::C14H30::C14H30(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + C14H30() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::C14H30::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const C14H30& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/C14H30/C14H30.H b/src/thermophysicalModels/properties/liquidProperties/C14H30/C14H30.H index bfa65436d..68351c2d4 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C14H30/C14H30.H +++ b/src/thermophysicalModels/properties/liquidProperties/C14H30/C14H30.H @@ -79,6 +79,8 @@ class C14H30 public: + friend class liquidProperties; + //- Runtime type information TypeName("C14H30"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const C14H30& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const C14H30& l); }; +Ostream& operator<<(Ostream& os, const C14H30& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/C16H34/C16H34.C b/src/thermophysicalModels/properties/liquidProperties/C16H34/C16H34.C index 12a00555b..bb9c5355d 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C16H34/C16H34.C +++ b/src/thermophysicalModels/properties/liquidProperties/C16H34/C16H34.C @@ -129,21 +129,27 @@ Foam::C16H34::C16H34 Foam::C16H34::C16H34(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + C16H34() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::C16H34::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const C16H34& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/C16H34/C16H34.H b/src/thermophysicalModels/properties/liquidProperties/C16H34/C16H34.H index 36085db54..a42139cc5 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C16H34/C16H34.H +++ b/src/thermophysicalModels/properties/liquidProperties/C16H34/C16H34.H @@ -79,6 +79,8 @@ class C16H34 public: + friend class liquidProperties; + //- Runtime type information TypeName("C16H34"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const C16H34& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const C16H34& l); }; +Ostream& operator<<(Ostream& os, const C16H34& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/C2H5OH/C2H5OH.C b/src/thermophysicalModels/properties/liquidProperties/C2H5OH/C2H5OH.C index a9d441a94..8f80b13a4 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C2H5OH/C2H5OH.C +++ b/src/thermophysicalModels/properties/liquidProperties/C2H5OH/C2H5OH.C @@ -129,21 +129,27 @@ Foam::C2H5OH::C2H5OH Foam::C2H5OH::C2H5OH(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + C2H5OH() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::C2H5OH::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const C2H5OH& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/C2H5OH/C2H5OH.H b/src/thermophysicalModels/properties/liquidProperties/C2H5OH/C2H5OH.H index 7296b4e34..4d06bdb04 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C2H5OH/C2H5OH.H +++ b/src/thermophysicalModels/properties/liquidProperties/C2H5OH/C2H5OH.H @@ -79,6 +79,8 @@ class C2H5OH public: + friend class liquidProperties; + //- Runtime type information TypeName("C2H5OH"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const C2H5OH& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const C2H5OH& l); }; +Ostream& operator<<(Ostream& os, const C2H5OH& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/C2H6/C2H6.C b/src/thermophysicalModels/properties/liquidProperties/C2H6/C2H6.C index 9cab052a7..bfa922171 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C2H6/C2H6.C +++ b/src/thermophysicalModels/properties/liquidProperties/C2H6/C2H6.C @@ -120,21 +120,27 @@ Foam::C2H6::C2H6 Foam::C2H6::C2H6(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + C2H6() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::C2H6::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const C2H6& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/C2H6/C2H6.H b/src/thermophysicalModels/properties/liquidProperties/C2H6/C2H6.H index ebed8aa44..9f69f7029 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C2H6/C2H6.H +++ b/src/thermophysicalModels/properties/liquidProperties/C2H6/C2H6.H @@ -79,6 +79,8 @@ class C2H6 public: + friend class liquidProperties; + //- Runtime type information TypeName("C2H6"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const C2H6& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const C2H6& l); }; +Ostream& operator<<(Ostream& os, const C2H6& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/C2H6O/C2H6O.C b/src/thermophysicalModels/properties/liquidProperties/C2H6O/C2H6O.C index bf0528dc0..94c46d94c 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C2H6O/C2H6O.C +++ b/src/thermophysicalModels/properties/liquidProperties/C2H6O/C2H6O.C @@ -130,21 +130,27 @@ Foam::C2H6O::C2H6O Foam::C2H6O::C2H6O(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + C2H6O() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::C2H6O::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const C2H6O& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/C2H6O/C2H6O.H b/src/thermophysicalModels/properties/liquidProperties/C2H6O/C2H6O.H index 0477b7993..ec54cee6c 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C2H6O/C2H6O.H +++ b/src/thermophysicalModels/properties/liquidProperties/C2H6O/C2H6O.H @@ -79,6 +79,8 @@ class C2H6O public: + friend class liquidProperties; + //- Runtime type information TypeName("C2H6O"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const C2H6O& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const C2H6O& l); }; +Ostream& operator<<(Ostream& os, const C2H6O& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/C3H6O/C3H6O.C b/src/thermophysicalModels/properties/liquidProperties/C3H6O/C3H6O.C index f617fd592..8495142bf 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C3H6O/C3H6O.C +++ b/src/thermophysicalModels/properties/liquidProperties/C3H6O/C3H6O.C @@ -129,21 +129,27 @@ Foam::C3H6O::C3H6O Foam::C3H6O::C3H6O(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + C3H6O() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::C3H6O::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const C3H6O& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/C3H6O/C3H6O.H b/src/thermophysicalModels/properties/liquidProperties/C3H6O/C3H6O.H index 9cafa3431..f1f770a52 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C3H6O/C3H6O.H +++ b/src/thermophysicalModels/properties/liquidProperties/C3H6O/C3H6O.H @@ -79,6 +79,8 @@ class C3H6O public: + friend class liquidProperties; + //- Runtime type information TypeName("C3H6O"); @@ -165,34 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - - friend Ostream& operator<<(Ostream& os, const C3H6O& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const C3H6O& l); }; +Ostream& operator<<(Ostream& os, const C3H6O& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/C3H8/C3H8.C b/src/thermophysicalModels/properties/liquidProperties/C3H8/C3H8.C index 58abb7117..6c827993e 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C3H8/C3H8.C +++ b/src/thermophysicalModels/properties/liquidProperties/C3H8/C3H8.C @@ -119,21 +119,27 @@ Foam::C3H8::C3H8 Foam::C3H8::C3H8(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + C3H8() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::C3H8::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const C3H8& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/C3H8/C3H8.H b/src/thermophysicalModels/properties/liquidProperties/C3H8/C3H8.H index 9d451dcd6..950b6e608 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C3H8/C3H8.H +++ b/src/thermophysicalModels/properties/liquidProperties/C3H8/C3H8.H @@ -79,6 +79,8 @@ class C3H8 public: + friend class liquidProperties; + //- Runtime type information TypeName("C3H8"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const C3H8& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const C3H8& l); }; +Ostream& operator<<(Ostream& os, const C3H8& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/C4H10O/C4H10O.C b/src/thermophysicalModels/properties/liquidProperties/C4H10O/C4H10O.C index 1012d7bcf..581e38fc3 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C4H10O/C4H10O.C +++ b/src/thermophysicalModels/properties/liquidProperties/C4H10O/C4H10O.C @@ -129,21 +129,27 @@ Foam::C4H10O::C4H10O Foam::C4H10O::C4H10O(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + C4H10O() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::C4H10O::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const C4H10O& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/C4H10O/C4H10O.H b/src/thermophysicalModels/properties/liquidProperties/C4H10O/C4H10O.H index 16072f1c8..1049d3692 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C4H10O/C4H10O.H +++ b/src/thermophysicalModels/properties/liquidProperties/C4H10O/C4H10O.H @@ -79,6 +79,8 @@ class C4H10O public: + friend class liquidProperties; + //- Runtime type information TypeName("C4H10O"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const C4H10O& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const C4H10O& l); }; +Ostream& operator<<(Ostream& os, const C4H10O& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/C6H14/C6H14.C b/src/thermophysicalModels/properties/liquidProperties/C6H14/C6H14.C index dfd50d0e3..91cfa8f91 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C6H14/C6H14.C +++ b/src/thermophysicalModels/properties/liquidProperties/C6H14/C6H14.C @@ -129,21 +129,27 @@ Foam::C6H14::C6H14 Foam::C6H14::C6H14(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + C6H14() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::C6H14::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const C6H14& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/C6H14/C6H14.H b/src/thermophysicalModels/properties/liquidProperties/C6H14/C6H14.H index 9769fc41d..da6301802 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C6H14/C6H14.H +++ b/src/thermophysicalModels/properties/liquidProperties/C6H14/C6H14.H @@ -79,6 +79,8 @@ class C6H14 public: + friend class liquidProperties; + //- Runtime type information TypeName("C6H14"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const C6H14& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const C6H14& l); }; +Ostream& operator<<(Ostream& os, const C6H14& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/C6H6/C6H6.C b/src/thermophysicalModels/properties/liquidProperties/C6H6/C6H6.C index a4c10bea0..fcce3cb51 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C6H6/C6H6.C +++ b/src/thermophysicalModels/properties/liquidProperties/C6H6/C6H6.C @@ -129,21 +129,27 @@ Foam::C6H6::C6H6 Foam::C6H6::C6H6(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + C6H6() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::C6H6::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const C6H6& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/C6H6/C6H6.H b/src/thermophysicalModels/properties/liquidProperties/C6H6/C6H6.H index 260f228e8..da7a6f32b 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C6H6/C6H6.H +++ b/src/thermophysicalModels/properties/liquidProperties/C6H6/C6H6.H @@ -79,6 +79,8 @@ class C6H6 public: + friend class liquidProperties; + //- Runtime type information TypeName("C6H6"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const C6H6& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const C6H6& l); }; +Ostream& operator<<(Ostream& os, const C6H6& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/C7H16/C7H16.C b/src/thermophysicalModels/properties/liquidProperties/C7H16/C7H16.C index c2032f547..d8e1101f1 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C7H16/C7H16.C +++ b/src/thermophysicalModels/properties/liquidProperties/C7H16/C7H16.C @@ -128,21 +128,27 @@ Foam::C7H16::C7H16 Foam::C7H16::C7H16(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + C7H16() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::C7H16::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const C7H16& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/C7H16/C7H16.H b/src/thermophysicalModels/properties/liquidProperties/C7H16/C7H16.H index f18c7bf38..c30a0d4cd 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C7H16/C7H16.H +++ b/src/thermophysicalModels/properties/liquidProperties/C7H16/C7H16.H @@ -79,6 +79,8 @@ class C7H16 public: + friend class liquidProperties; + //- Runtime type information TypeName("C7H16"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const C7H16& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const C7H16& l); }; +Ostream& operator<<(Ostream& os, const C7H16& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/C7H8/C7H8.C b/src/thermophysicalModels/properties/liquidProperties/C7H8/C7H8.C index 8b070065b..142a20a09 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C7H8/C7H8.C +++ b/src/thermophysicalModels/properties/liquidProperties/C7H8/C7H8.C @@ -129,21 +129,27 @@ Foam::C7H8::C7H8 Foam::C7H8::C7H8(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + C7H8() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::C7H8::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const C7H8& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/C7H8/C7H8.H b/src/thermophysicalModels/properties/liquidProperties/C7H8/C7H8.H index 28e018d7f..16bbb8364 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C7H8/C7H8.H +++ b/src/thermophysicalModels/properties/liquidProperties/C7H8/C7H8.H @@ -79,6 +79,8 @@ class C7H8 public: + friend class liquidProperties; + //- Runtime type information TypeName("C7H8"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const C7H8& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const C7H8& l); }; +Ostream& operator<<(Ostream& os, const C7H8& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/C8H10/C8H10.C b/src/thermophysicalModels/properties/liquidProperties/C8H10/C8H10.C index 95822a69f..99f021fa0 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C8H10/C8H10.C +++ b/src/thermophysicalModels/properties/liquidProperties/C8H10/C8H10.C @@ -129,21 +129,27 @@ Foam::C8H10::C8H10 Foam::C8H10::C8H10(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + C8H10() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::C8H10::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const C8H10& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/C8H10/C8H10.H b/src/thermophysicalModels/properties/liquidProperties/C8H10/C8H10.H index d53a9dc76..856071437 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C8H10/C8H10.H +++ b/src/thermophysicalModels/properties/liquidProperties/C8H10/C8H10.H @@ -78,6 +78,8 @@ class C8H10 public: + friend class liquidProperties; + //- Runtime type information TypeName("C8H10"); @@ -164,33 +166,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const C8H10& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const C8H10& l); }; +Ostream& operator<<(Ostream& os, const C8H10& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/C8H18/C8H18.C b/src/thermophysicalModels/properties/liquidProperties/C8H18/C8H18.C index 0bd8dad72..290984601 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C8H18/C8H18.C +++ b/src/thermophysicalModels/properties/liquidProperties/C8H18/C8H18.C @@ -129,21 +129,27 @@ Foam::C8H18::C8H18 Foam::C8H18::C8H18(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + C8H18() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::C8H18::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const C8H18& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/C8H18/C8H18.H b/src/thermophysicalModels/properties/liquidProperties/C8H18/C8H18.H index 3146c7f78..caf1ad885 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C8H18/C8H18.H +++ b/src/thermophysicalModels/properties/liquidProperties/C8H18/C8H18.H @@ -79,6 +79,8 @@ class C8H18 public: + friend class liquidProperties; + //- Runtime type information TypeName("C8H18"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const C8H18& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const C8H18& l); }; +Ostream& operator<<(Ostream& os, const C8H18& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/C9H20/C9H20.C b/src/thermophysicalModels/properties/liquidProperties/C9H20/C9H20.C index 803ec867f..2062ef8ed 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C9H20/C9H20.C +++ b/src/thermophysicalModels/properties/liquidProperties/C9H20/C9H20.C @@ -129,21 +129,27 @@ Foam::C9H20::C9H20 Foam::C9H20::C9H20(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + C9H20() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::C9H20::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const C9H20& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/C9H20/C9H20.H b/src/thermophysicalModels/properties/liquidProperties/C9H20/C9H20.H index 61ea898d9..72d2d6f93 100644 --- a/src/thermophysicalModels/properties/liquidProperties/C9H20/C9H20.H +++ b/src/thermophysicalModels/properties/liquidProperties/C9H20/C9H20.H @@ -79,6 +79,8 @@ class C9H20 public: + friend class liquidProperties; + //- Runtime type information TypeName("C9H20"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const C9H20& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const C9H20& l); }; +Ostream& operator<<(Ostream& os, const C9H20& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/CH3OH/CH3OH.C b/src/thermophysicalModels/properties/liquidProperties/CH3OH/CH3OH.C index 7e3918fc7..3e21b6633 100644 --- a/src/thermophysicalModels/properties/liquidProperties/CH3OH/CH3OH.C +++ b/src/thermophysicalModels/properties/liquidProperties/CH3OH/CH3OH.C @@ -129,21 +129,27 @@ Foam::CH3OH::CH3OH Foam::CH3OH::CH3OH(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + CH3OH() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::CH3OH::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const CH3OH& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/CH3OH/CH3OH.H b/src/thermophysicalModels/properties/liquidProperties/CH3OH/CH3OH.H index 705493ab0..0d359ed83 100644 --- a/src/thermophysicalModels/properties/liquidProperties/CH3OH/CH3OH.H +++ b/src/thermophysicalModels/properties/liquidProperties/CH3OH/CH3OH.H @@ -79,6 +79,8 @@ class CH3OH public: + friend class liquidProperties; + //- Runtime type information TypeName("CH3OH"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const CH3OH& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const CH3OH& l); }; +Ostream& operator<<(Ostream& os, const CH3OH& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/CH4N2O/CH4N2O.C b/src/thermophysicalModels/properties/liquidProperties/CH4N2O/CH4N2O.C index 7c218a20b..b7120cbed 100644 --- a/src/thermophysicalModels/properties/liquidProperties/CH4N2O/CH4N2O.C +++ b/src/thermophysicalModels/properties/liquidProperties/CH4N2O/CH4N2O.C @@ -113,21 +113,27 @@ Foam::CH4N2O::CH4N2O Foam::CH4N2O::CH4N2O(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + CH4N2O() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::CH4N2O::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const CH4N2O& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/CH4N2O/CH4N2O.H b/src/thermophysicalModels/properties/liquidProperties/CH4N2O/CH4N2O.H index 3a459e2a9..2e8be163a 100644 --- a/src/thermophysicalModels/properties/liquidProperties/CH4N2O/CH4N2O.H +++ b/src/thermophysicalModels/properties/liquidProperties/CH4N2O/CH4N2O.H @@ -79,6 +79,8 @@ class CH4N2O public: + friend class liquidProperties; + //- Runtime type information TypeName("CH4N2O"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const CH4N2O& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const CH4N2O& l); }; +Ostream& operator<<(Ostream& os, const CH4N2O& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/H2O/H2O.C b/src/thermophysicalModels/properties/liquidProperties/H2O/H2O.C index 5f705a706..eb211a946 100644 --- a/src/thermophysicalModels/properties/liquidProperties/H2O/H2O.C +++ b/src/thermophysicalModels/properties/liquidProperties/H2O/H2O.C @@ -138,25 +138,24 @@ Foam::H2O::H2O(const dictionary& dict) : H2O() { -// liquidProperties(dict), -// rho_(dict.subDict("rho")), - InfoInFunction; - if (dict.found("rho")) - { - rho_ = NSRDSfunc5(dict.subDict("rho")); - } -// pv_(dict.subDict("pv")), -// hl_(dict.subDict("hl")), -// Cp_(dict.subDict("Cp")), -// h_(dict.subDict("h")), -// Cpg_(dict.subDict("Cpg")), -// B_(dict.subDict("B")), -// mu_(dict.subDict("mu")), -// mug_(dict.subDict("mug")), -// kappa_(dict.subDict("K")), -// kappag_(dict.subDict("kappag")), -// sigma_(dict.subDict("sigma")), -// D_(dict.subDict("D")) + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::H2O::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const H2O& l) +{ + l.writeData(os); + return os; } diff --git a/src/thermophysicalModels/properties/liquidProperties/H2O/H2O.H b/src/thermophysicalModels/properties/liquidProperties/H2O/H2O.H index 542dfd66c..dfa48fd32 100644 --- a/src/thermophysicalModels/properties/liquidProperties/H2O/H2O.H +++ b/src/thermophysicalModels/properties/liquidProperties/H2O/H2O.H @@ -78,6 +78,8 @@ class H2O public: + friend class liquidProperties; + //- Runtime type information TypeName("H2O"); @@ -164,33 +166,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const H2O& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const H2O& l); }; +Ostream& operator<<(Ostream& os, const H2O& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/IC8H18/IC8H18.C b/src/thermophysicalModels/properties/liquidProperties/IC8H18/IC8H18.C index 77ba4be1d..7f6bd4a92 100644 --- a/src/thermophysicalModels/properties/liquidProperties/IC8H18/IC8H18.C +++ b/src/thermophysicalModels/properties/liquidProperties/IC8H18/IC8H18.C @@ -129,21 +129,27 @@ Foam::IC8H18::IC8H18 Foam::IC8H18::IC8H18(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + IC8H18() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::IC8H18::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const IC8H18& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/IC8H18/IC8H18.H b/src/thermophysicalModels/properties/liquidProperties/IC8H18/IC8H18.H index 9a2e06fdf..9be7f5885 100644 --- a/src/thermophysicalModels/properties/liquidProperties/IC8H18/IC8H18.H +++ b/src/thermophysicalModels/properties/liquidProperties/IC8H18/IC8H18.H @@ -79,6 +79,8 @@ class IC8H18 public: + friend class liquidProperties; + //- Runtime type information TypeName("IC8H18"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const IC8H18& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const IC8H18& l); }; +Ostream& operator<<(Ostream& os, const IC8H18& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/IDEA/IDEA.C b/src/thermophysicalModels/properties/liquidProperties/IDEA/IDEA.C index 01777a26c..99bf130a1 100644 --- a/src/thermophysicalModels/properties/liquidProperties/IDEA/IDEA.C +++ b/src/thermophysicalModels/properties/liquidProperties/IDEA/IDEA.C @@ -149,21 +149,27 @@ Foam::IDEA::IDEA Foam::IDEA::IDEA(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + IDEA() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::IDEA::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const IDEA& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/IDEA/IDEA.H b/src/thermophysicalModels/properties/liquidProperties/IDEA/IDEA.H index b34a7db9e..dccf97c4f 100644 --- a/src/thermophysicalModels/properties/liquidProperties/IDEA/IDEA.H +++ b/src/thermophysicalModels/properties/liquidProperties/IDEA/IDEA.H @@ -101,6 +101,8 @@ class IDEA public: + friend class liquidProperties; + //- Runtime type information TypeName("IDEA"); @@ -187,32 +189,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const IDEA& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const IDEA& l); }; +Ostream& operator<<(Ostream& os, const IDEA& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/MB/MB.C b/src/thermophysicalModels/properties/liquidProperties/MB/MB.C index d98ef565b..d101add34 100644 --- a/src/thermophysicalModels/properties/liquidProperties/MB/MB.C +++ b/src/thermophysicalModels/properties/liquidProperties/MB/MB.C @@ -113,21 +113,27 @@ Foam::MB::MB Foam::MB::MB(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + MB() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::MB::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const MB& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/MB/MB.H b/src/thermophysicalModels/properties/liquidProperties/MB/MB.H index 4f7e5a5db..9b0c7fd43 100644 --- a/src/thermophysicalModels/properties/liquidProperties/MB/MB.H +++ b/src/thermophysicalModels/properties/liquidProperties/MB/MB.H @@ -79,6 +79,8 @@ class MB public: + friend class liquidProperties; + //- Runtime type information TypeName("MB"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const MB& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const MB& l); }; +Ostream& operator<<(Ostream& os, const MB& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/N2/N2.C b/src/thermophysicalModels/properties/liquidProperties/N2/N2.C index f22e3b068..67e7f4b89 100644 --- a/src/thermophysicalModels/properties/liquidProperties/N2/N2.C +++ b/src/thermophysicalModels/properties/liquidProperties/N2/N2.C @@ -129,21 +129,27 @@ Foam::N2::N2 Foam::N2::N2(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + N2() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::N2::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const N2& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/N2/N2.H b/src/thermophysicalModels/properties/liquidProperties/N2/N2.H index 9bcc0cb67..db637e421 100644 --- a/src/thermophysicalModels/properties/liquidProperties/N2/N2.H +++ b/src/thermophysicalModels/properties/liquidProperties/N2/N2.H @@ -79,6 +79,8 @@ class N2 public: + friend class liquidProperties; + //- Runtime type information TypeName("N2"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const N2& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const N2& l); }; +Ostream& operator<<(Ostream& os, const N2& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/aC10H7CH3/aC10H7CH3.C b/src/thermophysicalModels/properties/liquidProperties/aC10H7CH3/aC10H7CH3.C index 562a59198..09a765204 100644 --- a/src/thermophysicalModels/properties/liquidProperties/aC10H7CH3/aC10H7CH3.C +++ b/src/thermophysicalModels/properties/liquidProperties/aC10H7CH3/aC10H7CH3.C @@ -121,21 +121,27 @@ Foam::aC10H7CH3::aC10H7CH3 Foam::aC10H7CH3::aC10H7CH3(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + aC10H7CH3() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::aC10H7CH3::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const aC10H7CH3& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/aC10H7CH3/aC10H7CH3.H b/src/thermophysicalModels/properties/liquidProperties/aC10H7CH3/aC10H7CH3.H index 04bdf8720..370609e2f 100644 --- a/src/thermophysicalModels/properties/liquidProperties/aC10H7CH3/aC10H7CH3.H +++ b/src/thermophysicalModels/properties/liquidProperties/aC10H7CH3/aC10H7CH3.H @@ -79,6 +79,8 @@ class aC10H7CH3 public: + friend class liquidProperties; + //- Runtime type information TypeName("aC11H10"); @@ -165,34 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } - + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const aC10H7CH3& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const aC10H7CH3& l); }; +Ostream& operator<<(Ostream& os, const aC10H7CH3& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/bC10H7CH3/bC10H7CH3.C b/src/thermophysicalModels/properties/liquidProperties/bC10H7CH3/bC10H7CH3.C index d2c2fd82d..5392da173 100644 --- a/src/thermophysicalModels/properties/liquidProperties/bC10H7CH3/bC10H7CH3.C +++ b/src/thermophysicalModels/properties/liquidProperties/bC10H7CH3/bC10H7CH3.C @@ -122,21 +122,27 @@ Foam::bC10H7CH3::bC10H7CH3 Foam::bC10H7CH3::bC10H7CH3(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + bC10H7CH3() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::bC10H7CH3::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const bC10H7CH3& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/bC10H7CH3/bC10H7CH3.H b/src/thermophysicalModels/properties/liquidProperties/bC10H7CH3/bC10H7CH3.H index 6f8966edf..07e700773 100644 --- a/src/thermophysicalModels/properties/liquidProperties/bC10H7CH3/bC10H7CH3.H +++ b/src/thermophysicalModels/properties/liquidProperties/bC10H7CH3/bC10H7CH3.H @@ -79,6 +79,8 @@ class bC10H7CH3 public: + friend class liquidProperties; + //- Runtime type information TypeName("bC11H10"); @@ -165,33 +167,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const bC10H7CH3& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const bC10H7CH3& l); }; +Ostream& operator<<(Ostream& os, const bC10H7CH3& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/iC3H8O/iC3H8O.C b/src/thermophysicalModels/properties/liquidProperties/iC3H8O/iC3H8O.C index c77141a9b..bcb9b4325 100644 --- a/src/thermophysicalModels/properties/liquidProperties/iC3H8O/iC3H8O.C +++ b/src/thermophysicalModels/properties/liquidProperties/iC3H8O/iC3H8O.C @@ -129,21 +129,27 @@ Foam::iC3H8O::iC3H8O Foam::iC3H8O::iC3H8O(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + iC3H8O() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::iC3H8O::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const iC3H8O& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/iC3H8O/iC3H8O.H b/src/thermophysicalModels/properties/liquidProperties/iC3H8O/iC3H8O.H index bac19d8d7..4f616f79d 100644 --- a/src/thermophysicalModels/properties/liquidProperties/iC3H8O/iC3H8O.H +++ b/src/thermophysicalModels/properties/liquidProperties/iC3H8O/iC3H8O.H @@ -77,6 +77,8 @@ class iC3H8O public: + friend class liquidProperties; + //- Runtime type information TypeName("iC3H8O"); @@ -164,33 +166,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const iC3H8O& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const iC3H8O& l); }; +Ostream& operator<<(Ostream& os, const iC3H8O& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidProperties.C b/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidProperties.C index c5db6942f..fa98b4094 100644 --- a/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidProperties.C +++ b/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidProperties.C @@ -275,6 +275,22 @@ Foam::scalar Foam::liquidProperties::pvInvert(scalar p) const } +void Foam::liquidProperties::readIfPresent(const dictionary &dict) +{ + dict.readIfPresent("W", W_); + dict.readIfPresent("Tc", Tc_); + dict.readIfPresent("Pc", Pc_); + dict.readIfPresent("Vc", Vc_); + dict.readIfPresent("Zc", Zc_); + dict.readIfPresent("Tt", Tt_); + dict.readIfPresent("Pt", Pt_); + dict.readIfPresent("Tb", Tb_); + dict.readIfPresent("dipm", dipm_); + dict.readIfPresent("omega", omega_); + dict.readIfPresent("delta", delta_); +} + + void Foam::liquidProperties::writeData(Ostream& os) const { os << W_ << token::SPACE @@ -291,4 +307,13 @@ void Foam::liquidProperties::writeData(Ostream& os) const } +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const liquidProperties& l) +{ + l.writeData(os); + return os; +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidProperties.H b/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidProperties.H index 54eb237b1..987f81a30 100644 --- a/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidProperties.H +++ b/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidProperties.H @@ -284,18 +284,47 @@ public: // I-O + //- Read and set the properties present it the given dictionary + void readIfPresent(const dictionary& dict); + + //- Read and set the function coefficients + // if present it the given dictionary + template + inline void readIfPresent + ( + Func& f, + const word& name, + const dictionary& dict + ); + + //- Read and set the function coefficients + // if present it the given dictionary + template + inline void readIfPresent + ( + Liquid& l, + const dictionary& dict + ); + //- Write the function coefficients virtual void writeData(Ostream& os) const; + //- Write the data for each of the property functions + template + inline void writeData + ( + const Liquid& l, + Ostream& os + ) const; + //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const liquidProperties& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const liquidProperties& l); }; +Ostream& operator<<(Ostream& os, const liquidProperties& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidPropertiesI.H b/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidPropertiesI.H index 61a0b8d5f..fb53db8c4 100644 --- a/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidPropertiesI.H +++ b/src/thermophysicalModels/properties/liquidProperties/liquidProperties/liquidPropertiesI.H @@ -137,4 +137,67 @@ inline Foam::scalar Foam::liquidProperties::alphah(scalar p, scalar T) const } +template +inline void Foam::liquidProperties::readIfPresent +( + Func& f, + const word& name, + const dictionary& dict +) +{ + if (dict.found(name)) + { + f = Func(dict.subDict(name)); + } +} + + +template +inline void Foam::liquidProperties::readIfPresent +( + Liquid& l, + const dictionary& dict +) +{ + l.liquidProperties::readIfPresent(dict); + readIfPresent(l.rho_, "rho", dict); + readIfPresent(l.pv_, "pv", dict); + readIfPresent(l.hl_, "hl", dict); + readIfPresent(l.Cp_, "Cp", dict); + readIfPresent(l.h_, "h", dict); + readIfPresent(l.Cpg_, "Cpg", dict); + readIfPresent(l.B_, "B", dict); + readIfPresent(l.mu_, "mu", dict); + readIfPresent(l.mug_, "mug", dict); + readIfPresent(l.kappa_, "K", dict); + readIfPresent(l.kappag_, "kappag", dict); + readIfPresent(l.sigma_, "sigma", dict); + readIfPresent(l.D_, "D", dict); +} + + +template +inline void Foam::liquidProperties::writeData +( + const Liquid& l, + Ostream& os +) const +{ + l.liquidProperties::writeData(os); os << nl; + l.rho_.writeData(os); os << nl; + l.pv_.writeData(os); os << nl; + l.hl_.writeData(os); os << nl; + l.Cp_.writeData(os); os << nl; + l.h_.writeData(os); os << nl; + l.Cpg_.writeData(os); os << nl; + l.B_.writeData(os); os << nl; + l.mu_.writeData(os); os << nl; + l.mug_.writeData(os); os << nl; + l.kappa_.writeData(os); os << nl; + l.kappag_.writeData(os); os << nl; + l.sigma_.writeData(os); os << nl; + l.D_.writeData(os); os << endl; +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/nC3H8O/nC3H8O.C b/src/thermophysicalModels/properties/liquidProperties/nC3H8O/nC3H8O.C index 419c0c192..dc2fac5b9 100644 --- a/src/thermophysicalModels/properties/liquidProperties/nC3H8O/nC3H8O.C +++ b/src/thermophysicalModels/properties/liquidProperties/nC3H8O/nC3H8O.C @@ -129,21 +129,27 @@ Foam::nC3H8O::nC3H8O Foam::nC3H8O::nC3H8O(const dictionary& dict) : - liquidProperties(dict), - rho_(dict.subDict("rho")), - pv_(dict.subDict("pv")), - hl_(dict.subDict("hl")), - Cp_(dict.subDict("Cp")), - h_(dict.subDict("h")), - Cpg_(dict.subDict("Cpg")), - B_(dict.subDict("B")), - mu_(dict.subDict("mu")), - mug_(dict.subDict("mug")), - kappa_(dict.subDict("K")), - kappag_(dict.subDict("kappag")), - sigma_(dict.subDict("sigma")), - D_(dict.subDict("D")) -{} + nC3H8O() +{ + readIfPresent(*this, dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::nC3H8O::writeData(Ostream& os) const +{ + liquidProperties::writeData(*this, os); +} + + +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const nC3H8O& l) +{ + l.writeData(os); + return os; +} // ************************************************************************* // diff --git a/src/thermophysicalModels/properties/liquidProperties/nC3H8O/nC3H8O.H b/src/thermophysicalModels/properties/liquidProperties/nC3H8O/nC3H8O.H index d5dec6a85..578e57bb2 100644 --- a/src/thermophysicalModels/properties/liquidProperties/nC3H8O/nC3H8O.H +++ b/src/thermophysicalModels/properties/liquidProperties/nC3H8O/nC3H8O.H @@ -77,6 +77,8 @@ class nC3H8O public: + friend class liquidProperties; + //- Runtime type information TypeName("nC3H8O"); @@ -164,33 +166,16 @@ public: // I-O //- Write the function coefficients - void writeData(Ostream& os) const - { - liquidProperties::writeData(os); os << nl; - rho_.writeData(os); os << nl; - pv_.writeData(os); os << nl; - hl_.writeData(os); os << nl; - Cp_.writeData(os); os << nl; - h_.writeData(os); os << nl; - Cpg_.writeData(os); os << nl; - B_.writeData(os); os << nl; - mu_.writeData(os); os << nl; - mug_.writeData(os); os << nl; - kappa_.writeData(os); os << nl; - kappag_.writeData(os); os << nl; - sigma_.writeData(os); os << nl; - D_.writeData(os); os << endl; - } + void writeData(Ostream& os) const; //- Ostream Operator - friend Ostream& operator<<(Ostream& os, const nC3H8O& l) - { - l.writeData(os); - return os; - } + friend Ostream& operator<<(Ostream& os, const nC3H8O& l); }; +Ostream& operator<<(Ostream& os, const nC3H8O& l); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam