diff --git a/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransport.C b/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransport.C index d23f60472..db8cc7302 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) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,6 +26,19 @@ License #include "sutherlandTransport.H" #include "IOstreams.H" +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template +Foam::scalar Foam::sutherlandTransport::readCoeff +( + const word& coeffName, + const dictionary& dict +) +{ + return readScalar(dict.subDict("transport").lookup(coeffName)); +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template @@ -43,8 +56,21 @@ template Foam::sutherlandTransport::sutherlandTransport(const dictionary& dict) : Thermo(dict), - As_(readScalar(dict.subDict("transport").lookup("As"))), - Ts_(readScalar(dict.subDict("transport").lookup("Ts"))) + As_(readCoeff("As", dict)), + Ts_(readCoeff("Ts", dict)) +{} + + +template +Foam::sutherlandTransport::sutherlandTransport +( + const Thermo& t, + const dictionary& dict +) +: + Thermo(t), + As_(readCoeff("As", dict)), + Ts_(readCoeff("Ts", dict)) {} @@ -53,19 +79,20 @@ Foam::sutherlandTransport::sutherlandTransport(const dictionary& dict) template void Foam::sutherlandTransport::write(Ostream& os) const { - os << this->specie::name() << endl; - os << token::BEGIN_BLOCK << incrIndent << nl; + os << this->specie::name() << endl + << token::BEGIN_BLOCK << incrIndent << nl; Thermo::write(os); dictionary dict("transport"); dict.add("As", As_); dict.add("Ts", Ts_); - os << indent << dict.dictName() << dict; - os << decrIndent << token::END_BLOCK << nl; + os << indent << dict.dictName() << dict + << decrIndent << token::END_BLOCK << nl; } + // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // template diff --git a/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransport.H b/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransport.H index 25973ac1d..e7da7b9a5 100644 --- a/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransport.H +++ b/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransport.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -114,6 +114,9 @@ class sutherlandTransport const scalar mu2, const scalar T2 ); + //- Read coefficient from dictionary + scalar readCoeff(const word& coeffName, const dictionary& dict); + public: @@ -144,6 +147,9 @@ public: //- Construct from dictionary sutherlandTransport(const dictionary& dict); + //- Construct from base thermo and dictionary + sutherlandTransport(const Thermo& t,const dictionary& dict); + //- Construct and return a clone inline autoPtr clone() const;