diff --git a/applications/test/dimensionedType/Test-dimensionedType.C b/applications/test/dimensionedType/Test-dimensionedType.C index ccf56fff6b..965de25ead 100644 --- a/applications/test/dimensionedType/Test-dimensionedType.C +++ b/applications/test/dimensionedType/Test-dimensionedType.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -21,8 +21,6 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . -Description - \*---------------------------------------------------------------------------*/ #include "dimensionedTensor.H" @@ -33,16 +31,19 @@ using namespace Foam; int main(int argc, char *argv[]) { - dimensionedTensor dt("dt", dimless, tensor(0, 1, 2, 3, 4, 5, 6, 7, 8)); + dimensionedTensor dt("dt", dimLength, tensor(0, 1, 2, 3, 4, 5, 6, 7, 8)); - Info<< dt.component(tensor::XX) << endl; + Info<< "dt.component(tensor::XX): " << dt.component(tensor::XX) << endl; - dimensionedScalar ds("ds", dimless, 1.0); + dimensionedScalar ds("ds", dimTime, 1.0); - Info<< ds*dt << " " << dt*ds << endl; + Info<< "ds*dt dt*ds: " << ds*dt << " " << dt*ds << endl; + dimensionedTensor dt2("dt2", dimLength, tensor(1, 1, 2, 3, 4, 5, 6, 7, 8)); + + Info<< "cmptMultiply(dt, dt2): " << cmptMultiply(dt, dt2) << endl; + Info<< "cmptDivide(dt, dt2): " << cmptDivide(dt, dt2) << endl; - // dimensionSet { Pout<< "dimensionSet construct from is:" << dimensionSet(IStringStream("[Pa m^2 s^-2]")()) @@ -53,7 +54,7 @@ int main(int argc, char *argv[]) is >> dset; Pout<< "dimensionSet read:" << dset << endl; } - // dimensionedType + { Pout<< "construct from is:" << dimensionedScalar(IStringStream("bla [Pa mm^2 s^-2] 3.0")()) diff --git a/etc/controlDict b/etc/controlDict index fba02069de..8f811534dc 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -266,6 +266,7 @@ DebugSwitches SingleKineticRateDevolatilisation 0; SingleMixtureFraction 0; Smagorinsky 0; + SolverPerformance 1; SpalartAllmaras 0; SpalartAllmarasDDES 0; SpalartAllmarasIDDES 0; diff --git a/src/OpenFOAM/containers/Lists/PtrList/PtrList.H b/src/OpenFOAM/containers/Lists/PtrList/PtrList.H index 94f7f89dbc..42c2b082c5 100644 --- a/src/OpenFOAM/containers/Lists/PtrList/PtrList.H +++ b/src/OpenFOAM/containers/Lists/PtrList/PtrList.H @@ -190,7 +190,7 @@ public: void clear(); //- Append an element at the end of the list - inline void append(const T*); + inline void append(T*); inline void append(const autoPtr&); inline void append(const tmp&); diff --git a/src/OpenFOAM/containers/Lists/PtrList/PtrListI.H b/src/OpenFOAM/containers/Lists/PtrList/PtrListI.H index 74fafa6da5..c901b5fed4 100644 --- a/src/OpenFOAM/containers/Lists/PtrList/PtrListI.H +++ b/src/OpenFOAM/containers/Lists/PtrList/PtrListI.H @@ -80,7 +80,7 @@ inline void Foam::PtrList::resize(const label newSize) template -inline void Foam::PtrList::append(const T* ptr) +inline void Foam::PtrList::append(T* ptr) { label sz = size(); this->setSize(sz+1); diff --git a/src/OpenFOAM/dimensionSet/dimensionSets.C b/src/OpenFOAM/dimensionSet/dimensionSets.C index 1e2b254da1..36fd3f0c6f 100644 --- a/src/OpenFOAM/dimensionSet/dimensionSets.C +++ b/src/OpenFOAM/dimensionSet/dimensionSets.C @@ -195,8 +195,13 @@ const dimensionSet dimPower(dimEnergy/dimTime); const dimensionSet dimPressure(dimForce/dimArea); const dimensionSet dimGasConstant(dimEnergy/dimMass/dimTemperature); const dimensionSet dimSpecificHeatCapacity(dimGasConstant); +const dimensionSet dimViscosity(dimArea/dimTime); +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::dimensionSets::dimensionSets @@ -239,16 +244,6 @@ Foam::dimensionSets::dimensionSets } conversionPivots_.setSize(conversion_.n()); LUDecompose(conversion_, conversionPivots_); - - //- possibly some optimisation here to detect identity matri - //if - //( - // conversionPivots_ == identity(conversionPivots_.size()) - // && conversion_ == I) - //) - //{ - // identity_ = true; - //} } } @@ -259,8 +254,4 @@ void Foam::dimensionSets::coefficients(scalarField& exponents) const } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/dimensionSet/dimensionSets.H b/src/OpenFOAM/dimensionSet/dimensionSets.H index bcd6a5edae..e5deea4420 100644 --- a/src/OpenFOAM/dimensionSet/dimensionSets.H +++ b/src/OpenFOAM/dimensionSet/dimensionSets.H @@ -71,7 +71,7 @@ extern const dimensionSet dimAcceleration; extern const dimensionSet dimPressure; extern const dimensionSet dimGasConstant; extern const dimensionSet dimSpecificHeatCapacity; - +extern const dimensionSet dimViscosity; class dimensionSets diff --git a/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C b/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C index b78fbed97a..d062c8ec3a 100644 --- a/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C +++ b/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C @@ -27,15 +27,10 @@ License #include "pTraits.H" #include "dictionary.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // template -dimensioned dimensioned::lookupOrDefault +Foam::dimensioned Foam::dimensioned::lookupOrDefault ( const word& name, const dictionary& dict, @@ -49,7 +44,7 @@ dimensioned dimensioned::lookupOrDefault template -dimensioned dimensioned::lookupOrAddToDict +Foam::dimensioned Foam::dimensioned::lookupOrAddToDict ( const word& name, dictionary& dict, @@ -65,7 +60,7 @@ dimensioned dimensioned::lookupOrAddToDict // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -dimensioned::dimensioned +Foam::dimensioned::dimensioned ( const word& name, const dimensionSet& dimSet, @@ -79,7 +74,7 @@ dimensioned::dimensioned template -dimensioned::dimensioned +Foam::dimensioned::dimensioned ( const word& name, const dimensioned& dt @@ -92,7 +87,7 @@ dimensioned::dimensioned template -dimensioned::dimensioned +Foam::dimensioned::dimensioned ( Istream& is ) @@ -104,7 +99,7 @@ dimensioned::dimensioned template -dimensioned::dimensioned +Foam::dimensioned::dimensioned ( const word& name, Istream& is @@ -121,7 +116,7 @@ dimensioned::dimensioned template -dimensioned::dimensioned +Foam::dimensioned::dimensioned ( const word& name, const dimensionSet& dimSet, @@ -172,7 +167,7 @@ dimensioned::dimensioned template -dimensioned::dimensioned +Foam::dimensioned::dimensioned () : name_("undefined"), @@ -184,46 +179,47 @@ dimensioned::dimensioned // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -const word& dimensioned::name() const +const Foam::word& Foam::dimensioned::name() const { return name_; } template -word& dimensioned::name() +Foam::word& Foam::dimensioned::name() { return name_; } template -const dimensionSet& dimensioned::dimensions() const +const Foam::dimensionSet& Foam::dimensioned::dimensions() const { return dimensions_; } template -dimensionSet& dimensioned::dimensions() +Foam::dimensionSet& Foam::dimensioned::dimensions() { return dimensions_; } template -const Type& dimensioned::value() const +const Type& Foam::dimensioned::value() const { return value_; } template -Type& dimensioned::value() +Type& Foam::dimensioned::value() { return value_; } template -dimensioned::cmptType> dimensioned::component +Foam::dimensioned::cmptType> +Foam::dimensioned::component ( const direction d ) const @@ -238,7 +234,7 @@ dimensioned::cmptType> dimensioned::component template -void dimensioned::replace +void Foam::dimensioned::replace ( const direction d, const dimensioned::cmptType>& dc @@ -250,14 +246,15 @@ void dimensioned::replace template -bool dimensioned::readIfPresent(const dictionary& dict) +bool Foam::dimensioned::readIfPresent(const dictionary& dict) { return dict.readIfPresent(name_, value_); } template -Foam::Istream& dimensioned::read(Istream& is, const dictionary& readSet) +Foam::Istream& +Foam::dimensioned::read(Istream& is, const dictionary& readSet) { // Read name is >> name_; @@ -281,7 +278,7 @@ Foam::Istream& dimensioned::read(Istream& is, const dictionary& readSet) template -Foam::Istream& dimensioned::read +Foam::Istream& Foam::dimensioned::read ( Istream& is, const HashTable& readSet @@ -310,7 +307,7 @@ Foam::Istream& dimensioned::read template -Foam::Istream& dimensioned::read(Istream& is) +Foam::Istream& Foam::dimensioned::read(Istream& is) { // Read name is >> name_; @@ -336,7 +333,8 @@ Foam::Istream& dimensioned::read(Istream& is) // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template -dimensioned::cmptType> dimensioned::operator[] +Foam::dimensioned::cmptType> +Foam::dimensioned::operator[] ( const direction d ) const @@ -346,7 +344,7 @@ dimensioned::cmptType> dimensioned::operator[] template -void dimensioned::operator+= +void Foam::dimensioned::operator+= ( const dimensioned& dt ) @@ -357,7 +355,7 @@ void dimensioned::operator+= template -void dimensioned::operator-= +void Foam::dimensioned::operator-= ( const dimensioned& dt ) @@ -368,7 +366,7 @@ void dimensioned::operator-= template -void dimensioned::operator*= +void Foam::dimensioned::operator*= ( const scalar s ) @@ -378,7 +376,7 @@ void dimensioned::operator*= template -void dimensioned::operator/= +void Foam::dimensioned::operator/= ( const scalar s ) @@ -390,8 +388,8 @@ void dimensioned::operator/= // * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * // template -dimensioned::type> -pow(const dimensioned& dt, typename powProduct::type) +Foam::dimensioned::type> +Foam::pow(const dimensioned& dt, typename powProduct::type) { return dimensioned::type> ( @@ -401,9 +399,10 @@ pow(const dimensioned& dt, typename powProduct::type) ); } + template -dimensioned::type> -sqr(const dimensioned& dt) +Foam::dimensioned::type> +Foam::sqr(const dimensioned& dt) { return dimensioned::type> ( @@ -414,7 +413,7 @@ sqr(const dimensioned& dt) } template -dimensioned magSqr(const dimensioned& dt) +Foam::dimensioned Foam::magSqr(const dimensioned& dt) { return dimensioned ( @@ -425,7 +424,7 @@ dimensioned magSqr(const dimensioned& dt) } template -dimensioned mag(const dimensioned& dt) +Foam::dimensioned Foam::mag(const dimensioned& dt) { return dimensioned ( @@ -437,7 +436,38 @@ dimensioned mag(const dimensioned& dt) template -dimensioned max +Foam::dimensioned Foam::cmptMultiply +( + const dimensioned& dt1, + const dimensioned& dt2 +) +{ + return dimensioned + ( + "cmptMultiply(" + dt1.name() + ',' + dt2.name() + ')', + cmptMultiply(dt1.dimensions(), dt2.dimensions()), + cmptMultiply(dt1.value(), dt2.value()) + ); +} + +template +Foam::dimensioned Foam::cmptDivide +( + const dimensioned& dt1, + const dimensioned& dt2 +) +{ + return dimensioned + ( + "cmptDivide(" + dt1.name() + ',' + dt2.name() + ')', + cmptDivide(dt1.dimensions(), dt2.dimensions()), + cmptDivide(dt1.value(), dt2.value()) + ); +} + + +template +Foam::dimensioned Foam::max ( const dimensioned& dt1, const dimensioned& dt2 @@ -460,7 +490,7 @@ dimensioned max template -dimensioned min +Foam::dimensioned Foam::min ( const dimensioned& dt1, const dimensioned& dt2 @@ -485,7 +515,7 @@ dimensioned min // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // template -Istream& operator>>(Istream& is, dimensioned& dt) +Foam::Istream& Foam::operator>>(Istream& is, dimensioned& dt) { token nextToken(is); is.putBack(nextToken); @@ -518,7 +548,7 @@ Istream& operator>>(Istream& is, dimensioned& dt) template -Ostream& operator<<(Ostream& os, const dimensioned& dt) +Foam::Ostream& Foam::operator<<(Ostream& os, const dimensioned& dt) { // Write the name os << dt.name() << token::SPACE; @@ -542,7 +572,7 @@ Ostream& operator<<(Ostream& os, const dimensioned& dt) // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * // template -bool operator> +bool Foam::operator> ( const dimensioned& dt1, const dimensioned& dt2 @@ -553,7 +583,7 @@ bool operator> template -bool operator< +bool Foam::operator< ( const dimensioned& dt1, const dimensioned& dt2 @@ -564,7 +594,7 @@ bool operator< template -dimensioned operator+ +Foam::dimensioned Foam::operator+ ( const dimensioned& dt1, const dimensioned& dt2 @@ -580,7 +610,7 @@ dimensioned operator+ template -dimensioned operator-(const dimensioned& dt) +Foam::dimensioned Foam::operator-(const dimensioned& dt) { return dimensioned ( @@ -592,7 +622,7 @@ dimensioned operator-(const dimensioned& dt) template -dimensioned operator- +Foam::dimensioned Foam::operator- ( const dimensioned& dt1, const dimensioned& dt2 @@ -608,7 +638,7 @@ dimensioned operator- template -dimensioned operator* +Foam::dimensioned Foam::operator* ( const dimensioned& ds, const dimensioned& dt @@ -624,7 +654,7 @@ dimensioned operator* template -dimensioned operator/ +Foam::dimensioned Foam::operator/ ( const dimensioned& dt, const dimensioned& ds @@ -645,8 +675,12 @@ dimensioned operator/ #define PRODUCT_OPERATOR(product, op, opFunc) \ \ template \ -dimensioned::type> \ -operator op(const dimensioned& dt1, const dimensioned& dt2) \ +Foam::dimensioned::type> \ +Foam::operator op \ +( \ + const dimensioned& dt1, \ + const dimensioned& dt2 \ +) \ { \ return dimensioned::type> \ ( \ @@ -657,8 +691,8 @@ operator op(const dimensioned& dt1, const dimensioned& dt2) \ } \ \ template \ -dimensioned::type> \ -operator op \ +Foam::dimensioned::type> \ +Foam::operator op \ ( \ const dimensioned& dt1, \ const VectorSpace& t2 \ @@ -673,8 +707,8 @@ operator op \ } \ \ template \ -dimensioned::type> \ -operator op \ +Foam::dimensioned::type> \ +Foam::operator op \ ( \ const VectorSpace& t1, \ const dimensioned& dt2 \ @@ -697,8 +731,4 @@ PRODUCT_OPERATOR(scalarProduct, &&, dotdot) #undef PRODUCT_OPERATOR -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/SolverPerformance.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/SolverPerformance.C index 5cf4e60efa..6a4cf06508 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/SolverPerformance.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/SolverPerformance.C @@ -65,8 +65,7 @@ bool Foam::SolverPerformance::checkConvergence { if (debug >= 2) { - //Info<< solverName_ - Pout<< solverName_ + Info<< solverName_ << ": Iteration " << noIterations_ << " residual = " << finalResidual_ << endl; diff --git a/src/OpenFOAM/primitives/SymmTensor/SymmTensorI.H b/src/OpenFOAM/primitives/SymmTensor/SymmTensorI.H index dce79844d8..19bcfb3842 100644 --- a/src/OpenFOAM/primitives/SymmTensor/SymmTensorI.H +++ b/src/OpenFOAM/primitives/SymmTensor/SymmTensorI.H @@ -529,7 +529,7 @@ class innerProduct, SymmTensor > { public: - typedef SymmTensor type; + typedef Tensor type; }; template diff --git a/src/OpenFOAM/primitives/one/one.H b/src/OpenFOAM/primitives/one/one.H index b0498a954c..28b7f487ab 100644 --- a/src/OpenFOAM/primitives/one/one.H +++ b/src/OpenFOAM/primitives/one/one.H @@ -61,7 +61,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -# include "oneI.H" +#include "oneI.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/one/oneI.H b/src/OpenFOAM/primitives/one/oneI.H index f51b8120d6..1a60bae27f 100644 --- a/src/OpenFOAM/primitives/one/oneI.H +++ b/src/OpenFOAM/primitives/one/oneI.H @@ -50,7 +50,6 @@ inline Type operator/(const one&, const Type& t) return scalar(1)/t; } - template inline const Type& operator/(const Type& t, const one&) { diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C index f1490ac9ce..333acca086 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C @@ -200,8 +200,10 @@ Foam::solverPerformance Foam::fvMatrix::solveSegregated solverControls )->solve(psiCmpt, sourceCmpt, cmpt); - //solverPerf.print(Info); - solverPerf.print(Info(this->mesh().comm())); + if (solverPerformance::debug) + { + solverPerf.print(Info(this->mesh().comm())); + } solverPerfVec = max(solverPerfVec, solverPerf); solverPerfVec.solverName() = solverPerf.solverName(); @@ -265,8 +267,10 @@ Foam::solverPerformance Foam::fvMatrix::solveCoupled coupledMatrixSolver->solve(psi) ); - //solverPerf.print(Info); - solverPerf.print(Info(this->mesh().comm())); + if (SolverPerformance::debug) + { + solverPerf.print(Info(this->mesh().comm())); + } psi.correctBoundaryConditions(); diff --git a/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C b/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C index 4a200f7476..7bd9c2a2c2 100644 --- a/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C +++ b/src/finiteVolume/fvMatrices/fvScalarMatrix/fvScalarMatrix.C @@ -118,7 +118,10 @@ Foam::solverPerformance Foam::fvMatrix::fvSolver::solve totalSource ); - solverPerf.print(Info(fvMat_.mesh().comm())); + if (solverPerformance::debug) + { + solverPerf.print(Info(fvMat_.mesh().comm())); + } fvMat_.diag() = saveDiag; @@ -165,7 +168,10 @@ Foam::solverPerformance Foam::fvMatrix::solveSegregated solverControls )->solve(psi.internalField(), totalSource); - solverPerf.print(Info(mesh().comm())); + if (solverPerformance::debug) + { + solverPerf.print(Info(mesh().comm())); + } diag() = saveDiag; diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolate.H b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolate.H index f6f0cf04b6..66dce3de59 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolate.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolate.H @@ -39,6 +39,7 @@ SourceFiles #include "volFieldsFwd.H" #include "surfaceFieldsFwd.H" #include "surfaceInterpolationScheme.H" +#include "one.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -183,6 +184,12 @@ namespace fvc ( const tmp >& tfvpff ); + + //- Interpolate 'one' returning 'one' + inline one interpolate(const one&) + { + return one(); + } } diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.C b/src/thermophysicalModels/basic/basicThermo/basicThermo.C index c3a736df7e..e7264b0a1f 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.C +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.C @@ -493,6 +493,12 @@ const Foam::volScalarField& Foam::basicThermo::alpha() const } +const Foam::scalarField& Foam::basicThermo::alpha(const label patchi) const +{ + return alpha_.boundaryField()[patchi]; +} + + bool Foam::basicThermo::read() { return regIOobject::read(); diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.H b/src/thermophysicalModels/basic/basicThermo/basicThermo.H index 29ac19aa57..4b91a3adc8 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.H +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.H @@ -267,6 +267,9 @@ public: //- Density [kg/m^3] virtual tmp rho() const = 0; + //- Density for patch [kg/m^3] + virtual tmp rho(const label patchi) const = 0; + //- Enthalpy/Internal energy [J/kg] // Non-const access allowed for transport equations virtual volScalarField& he() = 0; @@ -390,6 +393,12 @@ public: //- Thermal diffusivity for enthalpy of mixture [kg/m/s] virtual const volScalarField& alpha() const; + //- Thermal diffusivity for enthalpy of mixture for patch [kg/m/s] + virtual const scalarField& alpha + ( + const label patchi + ) const; + // Fields derived from transport state variables diff --git a/src/thermophysicalModels/basic/fluidThermo/fluidThermo.C b/src/thermophysicalModels/basic/fluidThermo/fluidThermo.C index f330c6ae81..9f536d842c 100644 --- a/src/thermophysicalModels/basic/fluidThermo/fluidThermo.C +++ b/src/thermophysicalModels/basic/fluidThermo/fluidThermo.C @@ -72,4 +72,18 @@ Foam::fluidThermo::~fluidThermo() {} +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::fluidThermo::nu() const +{ + return mu()/rho(); +} + + +Foam::tmp Foam::fluidThermo::nu(const label patchi) const +{ + return mu(patchi)/rho(patchi); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/basic/fluidThermo/fluidThermo.H b/src/thermophysicalModels/basic/fluidThermo/fluidThermo.H index d8612d7db5..c507699119 100644 --- a/src/thermophysicalModels/basic/fluidThermo/fluidThermo.H +++ b/src/thermophysicalModels/basic/fluidThermo/fluidThermo.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -109,6 +109,15 @@ public: //- Dynamic viscosity of mixture [kg/m/s] virtual const volScalarField& mu() const = 0; + + //- Dynamic viscosity of mixture for patch [kg/m/s] + virtual const scalarField& mu(const label patchi) const = 0; + + //- Kinematic viscosity of mixture [m^2/s] + virtual tmp nu() const; + + //- Kinematic viscosity of mixture for patch [m^2/s] + virtual tmp nu(const label patchi) const; }; diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.C b/src/thermophysicalModels/basic/heThermo/heThermo.C index fae178684f..d1b26c5e88 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.C +++ b/src/thermophysicalModels/basic/heThermo/heThermo.C @@ -788,26 +788,6 @@ Foam::heThermo::alphaEff } -template -Foam::tmp -Foam::heThermo::alpha -( - const label patchi -) const -{ - return - this->CpByCpv - ( - this->p_.boundaryField()[patchi], - this->T_.boundaryField()[patchi], - patchi - ) - *( - this->alpha_.boundaryField()[patchi] - ); -} - - template bool Foam::heThermo::read() { diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.H b/src/thermophysicalModels/basic/heThermo/heThermo.H index ce5c732427..c227769b6c 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.H +++ b/src/thermophysicalModels/basic/heThermo/heThermo.H @@ -260,7 +260,6 @@ public: virtual tmp kappa() const; //- Thermal diffusivity of mixture for patch [J/m/s/K] - virtual tmp kappa ( const label patchi @@ -290,12 +289,6 @@ public: const label patchi ) const; - //- Thermal diffusivity for enthalpy of mixture [kg/m/s] - virtual tmp alpha - ( - const label patchI - ) const; - //- Read thermophysical properties dictionary virtual bool read(); diff --git a/src/thermophysicalModels/basic/psiThermo/psiThermo.C b/src/thermophysicalModels/basic/psiThermo/psiThermo.C index dd69890313..263674d139 100644 --- a/src/thermophysicalModels/basic/psiThermo/psiThermo.C +++ b/src/thermophysicalModels/basic/psiThermo/psiThermo.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -92,7 +92,13 @@ Foam::psiThermo::~psiThermo() Foam::tmp Foam::psiThermo::rho() const { - return p_*psi(); + return p_*psi_; +} + + +Foam::tmp Foam::psiThermo::rho(const label patchi) const +{ + return p_.boundaryField()[patchi]*psi_.boundaryField()[patchi]; } @@ -108,4 +114,10 @@ const Foam::volScalarField& Foam::psiThermo::mu() const } +const Foam::scalarField& Foam::psiThermo::mu(const label patchi) const +{ + return mu_.boundaryField()[patchi]; +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/basic/psiThermo/psiThermo.H b/src/thermophysicalModels/basic/psiThermo/psiThermo.H index 7ac2973a5b..f59c62247e 100644 --- a/src/thermophysicalModels/basic/psiThermo/psiThermo.H +++ b/src/thermophysicalModels/basic/psiThermo/psiThermo.H @@ -115,6 +115,9 @@ public: //- Density [kg/m^3] - uses current value of pressure virtual tmp rho() const; + //- Density for patch [kg/m^3] + virtual tmp rho(const label patchi) const; + //- Compressibility [s^2/m^2] virtual const volScalarField& psi() const; @@ -123,6 +126,9 @@ public: //- Dynamic viscosity of mixture [kg/m/s] virtual const volScalarField& mu() const; + + //- Dynamic viscosity of mixture for patch [kg/m/s] + virtual const scalarField& mu(const label patchi) const; }; diff --git a/src/thermophysicalModels/basic/rhoThermo/rhoThermo.C b/src/thermophysicalModels/basic/rhoThermo/rhoThermo.C index d34186eea9..bfd171c40f 100644 --- a/src/thermophysicalModels/basic/rhoThermo/rhoThermo.C +++ b/src/thermophysicalModels/basic/rhoThermo/rhoThermo.C @@ -161,6 +161,12 @@ Foam::tmp Foam::rhoThermo::rho() const } +Foam::tmp Foam::rhoThermo::rho(const label patchi) const +{ + return rho_.boundaryField()[patchi]; +} + + Foam::volScalarField& Foam::rhoThermo::rho() { return rho_; @@ -179,4 +185,10 @@ const Foam::volScalarField& Foam::rhoThermo::mu() const } +const Foam::scalarField& Foam::rhoThermo::mu(const label patchi) const +{ + return mu_.boundaryField()[patchi]; +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/basic/rhoThermo/rhoThermo.H b/src/thermophysicalModels/basic/rhoThermo/rhoThermo.H index 4202267e2b..3067d51992 100644 --- a/src/thermophysicalModels/basic/rhoThermo/rhoThermo.H +++ b/src/thermophysicalModels/basic/rhoThermo/rhoThermo.H @@ -127,6 +127,9 @@ public: //- Density [kg/m^3] virtual tmp rho() const; + //- Density for patch [kg/m^3] + virtual tmp rho(const label patchi) const; + //- Return non-const access to the local density field [kg/m^3] virtual volScalarField& rho(); @@ -138,6 +141,9 @@ public: //- Dynamic viscosity of mixture [kg/m/s] virtual const volScalarField& mu() const; + + //- Dynamic viscosity of mixture for patch [kg/m/s] + virtual const scalarField& mu(const label patchi) const; }; diff --git a/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.C b/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.C index 2e12bcf213..548dd97663 100644 --- a/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.C +++ b/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.C @@ -123,6 +123,12 @@ Foam::tmp Foam::solidThermo::rho() const } +Foam::tmp Foam::solidThermo::rho(const label patchi) const +{ + return rho_.boundaryField()[patchi]; +} + + Foam::volScalarField& Foam::solidThermo::rho() { return rho_; diff --git a/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H b/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H index e14fba7c82..cdae056126 100644 --- a/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H +++ b/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H @@ -138,6 +138,9 @@ public: //- Density [kg/m^3] virtual tmp rho() const; + //- Density for patch [kg/m^3] + virtual tmp rho(const label patchi) const = 0; + //- Return non-const access to the local density field [kg/m^3] virtual volScalarField& rho();