mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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")())
|
||||
|
||||
@ -266,6 +266,7 @@ DebugSwitches
|
||||
SingleKineticRateDevolatilisation 0;
|
||||
SingleMixtureFraction 0;
|
||||
Smagorinsky 0;
|
||||
SolverPerformance 1;
|
||||
SpalartAllmaras 0;
|
||||
SpalartAllmarasDDES 0;
|
||||
SpalartAllmarasIDDES 0;
|
||||
|
||||
@ -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<T>&);
|
||||
inline void append(const tmp<T>&);
|
||||
|
||||
|
||||
@ -80,7 +80,7 @@ inline void Foam::PtrList<T>::resize(const label newSize)
|
||||
|
||||
|
||||
template<class T>
|
||||
inline void Foam::PtrList<T>::append(const T* ptr)
|
||||
inline void Foam::PtrList<T>::append(T* ptr)
|
||||
{
|
||||
label sz = size();
|
||||
this->setSize(sz+1);
|
||||
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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
|
||||
|
||||
@ -27,15 +27,10 @@ License
|
||||
#include "pTraits.H"
|
||||
#include "dictionary.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type> dimensioned<Type>::lookupOrDefault
|
||||
Foam::dimensioned<Type> Foam::dimensioned<Type>::lookupOrDefault
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& dict,
|
||||
@ -49,7 +44,7 @@ dimensioned<Type> dimensioned<Type>::lookupOrDefault
|
||||
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type> dimensioned<Type>::lookupOrAddToDict
|
||||
Foam::dimensioned<Type> Foam::dimensioned<Type>::lookupOrAddToDict
|
||||
(
|
||||
const word& name,
|
||||
dictionary& dict,
|
||||
@ -65,7 +60,7 @@ dimensioned<Type> dimensioned<Type>::lookupOrAddToDict
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type>::dimensioned
|
||||
Foam::dimensioned<Type>::dimensioned
|
||||
(
|
||||
const word& name,
|
||||
const dimensionSet& dimSet,
|
||||
@ -79,7 +74,7 @@ dimensioned<Type>::dimensioned
|
||||
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type>::dimensioned
|
||||
Foam::dimensioned<Type>::dimensioned
|
||||
(
|
||||
const word& name,
|
||||
const dimensioned<Type>& dt
|
||||
@ -92,7 +87,7 @@ dimensioned<Type>::dimensioned
|
||||
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type>::dimensioned
|
||||
Foam::dimensioned<Type>::dimensioned
|
||||
(
|
||||
Istream& is
|
||||
)
|
||||
@ -104,7 +99,7 @@ dimensioned<Type>::dimensioned
|
||||
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type>::dimensioned
|
||||
Foam::dimensioned<Type>::dimensioned
|
||||
(
|
||||
const word& name,
|
||||
Istream& is
|
||||
@ -121,7 +116,7 @@ dimensioned<Type>::dimensioned
|
||||
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type>::dimensioned
|
||||
Foam::dimensioned<Type>::dimensioned
|
||||
(
|
||||
const word& name,
|
||||
const dimensionSet& dimSet,
|
||||
@ -172,7 +167,7 @@ dimensioned<Type>::dimensioned
|
||||
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type>::dimensioned
|
||||
Foam::dimensioned<Type>::dimensioned
|
||||
()
|
||||
:
|
||||
name_("undefined"),
|
||||
@ -184,46 +179,47 @@ dimensioned<Type>::dimensioned
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
const word& dimensioned<Type>::name() const
|
||||
const Foam::word& Foam::dimensioned<Type>::name() const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
word& dimensioned<Type>::name()
|
||||
Foam::word& Foam::dimensioned<Type>::name()
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
const dimensionSet& dimensioned<Type>::dimensions() const
|
||||
const Foam::dimensionSet& Foam::dimensioned<Type>::dimensions() const
|
||||
{
|
||||
return dimensions_;
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
dimensionSet& dimensioned<Type>::dimensions()
|
||||
Foam::dimensionSet& Foam::dimensioned<Type>::dimensions()
|
||||
{
|
||||
return dimensions_;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
const Type& dimensioned<Type>::value() const
|
||||
const Type& Foam::dimensioned<Type>::value() const
|
||||
{
|
||||
return value_;
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
Type& dimensioned<Type>::value()
|
||||
Type& Foam::dimensioned<Type>::value()
|
||||
{
|
||||
return value_;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
dimensioned<typename dimensioned<Type>::cmptType> dimensioned<Type>::component
|
||||
Foam::dimensioned<typename Foam::dimensioned<Type>::cmptType>
|
||||
Foam::dimensioned<Type>::component
|
||||
(
|
||||
const direction d
|
||||
) const
|
||||
@ -238,7 +234,7 @@ dimensioned<typename dimensioned<Type>::cmptType> dimensioned<Type>::component
|
||||
|
||||
|
||||
template<class Type>
|
||||
void dimensioned<Type>::replace
|
||||
void Foam::dimensioned<Type>::replace
|
||||
(
|
||||
const direction d,
|
||||
const dimensioned<typename dimensioned<Type>::cmptType>& dc
|
||||
@ -250,14 +246,15 @@ void dimensioned<Type>::replace
|
||||
|
||||
|
||||
template<class Type>
|
||||
bool dimensioned<Type>::readIfPresent(const dictionary& dict)
|
||||
bool Foam::dimensioned<Type>::readIfPresent(const dictionary& dict)
|
||||
{
|
||||
return dict.readIfPresent(name_, value_);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::Istream& dimensioned<Type>::read(Istream& is, const dictionary& readSet)
|
||||
Foam::Istream&
|
||||
Foam::dimensioned<Type>::read(Istream& is, const dictionary& readSet)
|
||||
{
|
||||
// Read name
|
||||
is >> name_;
|
||||
@ -281,7 +278,7 @@ Foam::Istream& dimensioned<Type>::read(Istream& is, const dictionary& readSet)
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::Istream& dimensioned<Type>::read
|
||||
Foam::Istream& Foam::dimensioned<Type>::read
|
||||
(
|
||||
Istream& is,
|
||||
const HashTable<dimensionedScalar>& readSet
|
||||
@ -310,7 +307,7 @@ Foam::Istream& dimensioned<Type>::read
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::Istream& dimensioned<Type>::read(Istream& is)
|
||||
Foam::Istream& Foam::dimensioned<Type>::read(Istream& is)
|
||||
{
|
||||
// Read name
|
||||
is >> name_;
|
||||
@ -336,7 +333,8 @@ Foam::Istream& dimensioned<Type>::read(Istream& is)
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
dimensioned<typename dimensioned<Type>::cmptType> dimensioned<Type>::operator[]
|
||||
Foam::dimensioned<typename Foam::dimensioned<Type>::cmptType>
|
||||
Foam::dimensioned<Type>::operator[]
|
||||
(
|
||||
const direction d
|
||||
) const
|
||||
@ -346,7 +344,7 @@ dimensioned<typename dimensioned<Type>::cmptType> dimensioned<Type>::operator[]
|
||||
|
||||
|
||||
template<class Type>
|
||||
void dimensioned<Type>::operator+=
|
||||
void Foam::dimensioned<Type>::operator+=
|
||||
(
|
||||
const dimensioned<Type>& dt
|
||||
)
|
||||
@ -357,7 +355,7 @@ void dimensioned<Type>::operator+=
|
||||
|
||||
|
||||
template<class Type>
|
||||
void dimensioned<Type>::operator-=
|
||||
void Foam::dimensioned<Type>::operator-=
|
||||
(
|
||||
const dimensioned<Type>& dt
|
||||
)
|
||||
@ -368,7 +366,7 @@ void dimensioned<Type>::operator-=
|
||||
|
||||
|
||||
template<class Type>
|
||||
void dimensioned<Type>::operator*=
|
||||
void Foam::dimensioned<Type>::operator*=
|
||||
(
|
||||
const scalar s
|
||||
)
|
||||
@ -378,7 +376,7 @@ void dimensioned<Type>::operator*=
|
||||
|
||||
|
||||
template<class Type>
|
||||
void dimensioned<Type>::operator/=
|
||||
void Foam::dimensioned<Type>::operator/=
|
||||
(
|
||||
const scalar s
|
||||
)
|
||||
@ -390,8 +388,8 @@ void dimensioned<Type>::operator/=
|
||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type, int r>
|
||||
dimensioned<typename powProduct<Type, r>::type>
|
||||
pow(const dimensioned<Type>& dt, typename powProduct<Type, r>::type)
|
||||
Foam::dimensioned<typename Foam::powProduct<Type, r>::type>
|
||||
Foam::pow(const dimensioned<Type>& dt, typename powProduct<Type, r>::type)
|
||||
{
|
||||
return dimensioned<typename powProduct<Type, r>::type>
|
||||
(
|
||||
@ -401,9 +399,10 @@ pow(const dimensioned<Type>& dt, typename powProduct<Type, r>::type)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
dimensioned<typename outerProduct<Type, Type>::type>
|
||||
sqr(const dimensioned<Type>& dt)
|
||||
Foam::dimensioned<typename Foam::outerProduct<Type, Type>::type>
|
||||
Foam::sqr(const dimensioned<Type>& dt)
|
||||
{
|
||||
return dimensioned<typename outerProduct<Type, Type>::type>
|
||||
(
|
||||
@ -414,7 +413,7 @@ sqr(const dimensioned<Type>& dt)
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
dimensioned<scalar> magSqr(const dimensioned<Type>& dt)
|
||||
Foam::dimensioned<Foam::scalar> Foam::magSqr(const dimensioned<Type>& dt)
|
||||
{
|
||||
return dimensioned<scalar>
|
||||
(
|
||||
@ -425,7 +424,7 @@ dimensioned<scalar> magSqr(const dimensioned<Type>& dt)
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
dimensioned<scalar> mag(const dimensioned<Type>& dt)
|
||||
Foam::dimensioned<Foam::scalar> Foam::mag(const dimensioned<Type>& dt)
|
||||
{
|
||||
return dimensioned<scalar>
|
||||
(
|
||||
@ -437,7 +436,38 @@ dimensioned<scalar> mag(const dimensioned<Type>& dt)
|
||||
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type> max
|
||||
Foam::dimensioned<Type> Foam::cmptMultiply
|
||||
(
|
||||
const dimensioned<Type>& dt1,
|
||||
const dimensioned<Type>& dt2
|
||||
)
|
||||
{
|
||||
return dimensioned<Type>
|
||||
(
|
||||
"cmptMultiply(" + dt1.name() + ',' + dt2.name() + ')',
|
||||
cmptMultiply(dt1.dimensions(), dt2.dimensions()),
|
||||
cmptMultiply(dt1.value(), dt2.value())
|
||||
);
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
Foam::dimensioned<Type> Foam::cmptDivide
|
||||
(
|
||||
const dimensioned<Type>& dt1,
|
||||
const dimensioned<Type>& dt2
|
||||
)
|
||||
{
|
||||
return dimensioned<Type>
|
||||
(
|
||||
"cmptDivide(" + dt1.name() + ',' + dt2.name() + ')',
|
||||
cmptDivide(dt1.dimensions(), dt2.dimensions()),
|
||||
cmptDivide(dt1.value(), dt2.value())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::dimensioned<Type> Foam::max
|
||||
(
|
||||
const dimensioned<Type>& dt1,
|
||||
const dimensioned<Type>& dt2
|
||||
@ -460,7 +490,7 @@ dimensioned<Type> max
|
||||
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type> min
|
||||
Foam::dimensioned<Type> Foam::min
|
||||
(
|
||||
const dimensioned<Type>& dt1,
|
||||
const dimensioned<Type>& dt2
|
||||
@ -485,7 +515,7 @@ dimensioned<Type> min
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Istream& operator>>(Istream& is, dimensioned<Type>& dt)
|
||||
Foam::Istream& Foam::operator>>(Istream& is, dimensioned<Type>& dt)
|
||||
{
|
||||
token nextToken(is);
|
||||
is.putBack(nextToken);
|
||||
@ -518,7 +548,7 @@ Istream& operator>>(Istream& is, dimensioned<Type>& dt)
|
||||
|
||||
|
||||
template<class Type>
|
||||
Ostream& operator<<(Ostream& os, const dimensioned<Type>& dt)
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const dimensioned<Type>& dt)
|
||||
{
|
||||
// Write the name
|
||||
os << dt.name() << token::SPACE;
|
||||
@ -542,7 +572,7 @@ Ostream& operator<<(Ostream& os, const dimensioned<Type>& dt)
|
||||
// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
bool operator>
|
||||
bool Foam::operator>
|
||||
(
|
||||
const dimensioned<Type>& dt1,
|
||||
const dimensioned<Type>& dt2
|
||||
@ -553,7 +583,7 @@ bool operator>
|
||||
|
||||
|
||||
template<class Type>
|
||||
bool operator<
|
||||
bool Foam::operator<
|
||||
(
|
||||
const dimensioned<Type>& dt1,
|
||||
const dimensioned<Type>& dt2
|
||||
@ -564,7 +594,7 @@ bool operator<
|
||||
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type> operator+
|
||||
Foam::dimensioned<Type> Foam::operator+
|
||||
(
|
||||
const dimensioned<Type>& dt1,
|
||||
const dimensioned<Type>& dt2
|
||||
@ -580,7 +610,7 @@ dimensioned<Type> operator+
|
||||
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type> operator-(const dimensioned<Type>& dt)
|
||||
Foam::dimensioned<Type> Foam::operator-(const dimensioned<Type>& dt)
|
||||
{
|
||||
return dimensioned<Type>
|
||||
(
|
||||
@ -592,7 +622,7 @@ dimensioned<Type> operator-(const dimensioned<Type>& dt)
|
||||
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type> operator-
|
||||
Foam::dimensioned<Type> Foam::operator-
|
||||
(
|
||||
const dimensioned<Type>& dt1,
|
||||
const dimensioned<Type>& dt2
|
||||
@ -608,7 +638,7 @@ dimensioned<Type> operator-
|
||||
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type> operator*
|
||||
Foam::dimensioned<Type> Foam::operator*
|
||||
(
|
||||
const dimensioned<scalar>& ds,
|
||||
const dimensioned<Type>& dt
|
||||
@ -624,7 +654,7 @@ dimensioned<Type> operator*
|
||||
|
||||
|
||||
template<class Type>
|
||||
dimensioned<Type> operator/
|
||||
Foam::dimensioned<Type> Foam::operator/
|
||||
(
|
||||
const dimensioned<Type>& dt,
|
||||
const dimensioned<scalar>& ds
|
||||
@ -645,8 +675,12 @@ dimensioned<Type> operator/
|
||||
#define PRODUCT_OPERATOR(product, op, opFunc) \
|
||||
\
|
||||
template<class Type1, class Type2> \
|
||||
dimensioned<typename product<Type1, Type2>::type> \
|
||||
operator op(const dimensioned<Type1>& dt1, const dimensioned<Type2>& dt2) \
|
||||
Foam::dimensioned<typename Foam::product<Type1, Type2>::type> \
|
||||
Foam::operator op \
|
||||
( \
|
||||
const dimensioned<Type1>& dt1, \
|
||||
const dimensioned<Type2>& dt2 \
|
||||
) \
|
||||
{ \
|
||||
return dimensioned<typename product<Type1, Type2>::type> \
|
||||
( \
|
||||
@ -657,8 +691,8 @@ operator op(const dimensioned<Type1>& dt1, const dimensioned<Type2>& dt2) \
|
||||
} \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
dimensioned<typename product<Type, Form>::type> \
|
||||
operator op \
|
||||
Foam::dimensioned<typename Foam::product<Type, Form>::type> \
|
||||
Foam::operator op \
|
||||
( \
|
||||
const dimensioned<Type>& dt1, \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& t2 \
|
||||
@ -673,8 +707,8 @@ operator op \
|
||||
} \
|
||||
\
|
||||
template<class Type, class Form, class Cmpt, int nCmpt> \
|
||||
dimensioned<typename product<Form, Type>::type> \
|
||||
operator op \
|
||||
Foam::dimensioned<typename Foam::product<Form, Type>::type> \
|
||||
Foam::operator op \
|
||||
( \
|
||||
const VectorSpace<Form,Cmpt,nCmpt>& t1, \
|
||||
const dimensioned<Type>& dt2 \
|
||||
@ -697,8 +731,4 @@ PRODUCT_OPERATOR(scalarProduct, &&, dotdot)
|
||||
#undef PRODUCT_OPERATOR
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -65,8 +65,7 @@ bool Foam::SolverPerformance<Type>::checkConvergence
|
||||
{
|
||||
if (debug >= 2)
|
||||
{
|
||||
//Info<< solverName_
|
||||
Pout<< solverName_
|
||||
Info<< solverName_
|
||||
<< ": Iteration " << noIterations_
|
||||
<< " residual = " << finalResidual_
|
||||
<< endl;
|
||||
|
||||
@ -529,7 +529,7 @@ class innerProduct<SymmTensor<Cmpt>, SymmTensor<Cmpt> >
|
||||
{
|
||||
public:
|
||||
|
||||
typedef SymmTensor<Cmpt> type;
|
||||
typedef Tensor<Cmpt> type;
|
||||
};
|
||||
|
||||
template<class Cmpt>
|
||||
|
||||
@ -61,7 +61,7 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
# include "oneI.H"
|
||||
#include "oneI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -50,7 +50,6 @@ inline Type operator/(const one&, const Type& t)
|
||||
return scalar(1)/t;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
inline const Type& operator/(const Type& t, const one&)
|
||||
{
|
||||
|
||||
@ -200,8 +200,10 @@ Foam::solverPerformance Foam::fvMatrix<Type>::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<Type>::solveCoupled
|
||||
coupledMatrixSolver->solve(psi)
|
||||
);
|
||||
|
||||
//solverPerf.print(Info);
|
||||
solverPerf.print(Info(this->mesh().comm()));
|
||||
if (SolverPerformance<Type>::debug)
|
||||
{
|
||||
solverPerf.print(Info(this->mesh().comm()));
|
||||
}
|
||||
|
||||
psi.correctBoundaryConditions();
|
||||
|
||||
|
||||
@ -118,7 +118,10 @@ Foam::solverPerformance Foam::fvMatrix<Foam::scalar>::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<Foam::scalar>::solveSegregated
|
||||
solverControls
|
||||
)->solve(psi.internalField(), totalSource);
|
||||
|
||||
solverPerf.print(Info(mesh().comm()));
|
||||
if (solverPerformance::debug)
|
||||
{
|
||||
solverPerf.print(Info(mesh().comm()));
|
||||
}
|
||||
|
||||
diag() = saveDiag;
|
||||
|
||||
|
||||
@ -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<FieldField<fvPatchField, Type> >& tfvpff
|
||||
);
|
||||
|
||||
//- Interpolate 'one' returning 'one'
|
||||
inline one interpolate(const one&)
|
||||
{
|
||||
return one();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -267,6 +267,9 @@ public:
|
||||
//- Density [kg/m^3]
|
||||
virtual tmp<volScalarField> rho() const = 0;
|
||||
|
||||
//- Density for patch [kg/m^3]
|
||||
virtual tmp<scalarField> 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
|
||||
|
||||
|
||||
@ -72,4 +72,18 @@ Foam::fluidThermo::~fluidThermo()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::fluidThermo::nu() const
|
||||
{
|
||||
return mu()/rho();
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::fluidThermo::nu(const label patchi) const
|
||||
{
|
||||
return mu(patchi)/rho(patchi);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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<volScalarField> nu() const;
|
||||
|
||||
//- Kinematic viscosity of mixture for patch [m^2/s]
|
||||
virtual tmp<scalarField> nu(const label patchi) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -788,26 +788,6 @@ Foam::heThermo<BasicThermo, MixtureType>::alphaEff
|
||||
}
|
||||
|
||||
|
||||
template<class BasicThermo, class MixtureType>
|
||||
Foam::tmp<Foam::scalarField>
|
||||
Foam::heThermo<BasicThermo, MixtureType>::alpha
|
||||
(
|
||||
const label patchi
|
||||
) const
|
||||
{
|
||||
return
|
||||
this->CpByCpv
|
||||
(
|
||||
this->p_.boundaryField()[patchi],
|
||||
this->T_.boundaryField()[patchi],
|
||||
patchi
|
||||
)
|
||||
*(
|
||||
this->alpha_.boundaryField()[patchi]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class BasicThermo, class MixtureType>
|
||||
bool Foam::heThermo<BasicThermo, MixtureType>::read()
|
||||
{
|
||||
|
||||
@ -260,7 +260,6 @@ public:
|
||||
virtual tmp<volScalarField> kappa() const;
|
||||
|
||||
//- Thermal diffusivity of mixture for patch [J/m/s/K]
|
||||
|
||||
virtual tmp<scalarField> kappa
|
||||
(
|
||||
const label patchi
|
||||
@ -290,12 +289,6 @@ public:
|
||||
const label patchi
|
||||
) const;
|
||||
|
||||
//- Thermal diffusivity for enthalpy of mixture [kg/m/s]
|
||||
virtual tmp<scalarField> alpha
|
||||
(
|
||||
const label patchI
|
||||
) const;
|
||||
|
||||
|
||||
//- Read thermophysical properties dictionary
|
||||
virtual bool read();
|
||||
|
||||
@ -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::volScalarField> Foam::psiThermo::rho() const
|
||||
{
|
||||
return p_*psi();
|
||||
return p_*psi_;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> 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];
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -115,6 +115,9 @@ public:
|
||||
//- Density [kg/m^3] - uses current value of pressure
|
||||
virtual tmp<volScalarField> rho() const;
|
||||
|
||||
//- Density for patch [kg/m^3]
|
||||
virtual tmp<scalarField> 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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -161,6 +161,12 @@ Foam::tmp<Foam::volScalarField> Foam::rhoThermo::rho() const
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> 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];
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -127,6 +127,9 @@ public:
|
||||
//- Density [kg/m^3]
|
||||
virtual tmp<volScalarField> rho() const;
|
||||
|
||||
//- Density for patch [kg/m^3]
|
||||
virtual tmp<scalarField> 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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -123,6 +123,12 @@ Foam::tmp<Foam::volScalarField> Foam::solidThermo::rho() const
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::solidThermo::rho(const label patchi) const
|
||||
{
|
||||
return rho_.boundaryField()[patchi];
|
||||
}
|
||||
|
||||
|
||||
Foam::volScalarField& Foam::solidThermo::rho()
|
||||
{
|
||||
return rho_;
|
||||
|
||||
@ -138,6 +138,9 @@ public:
|
||||
//- Density [kg/m^3]
|
||||
virtual tmp<volScalarField> rho() const;
|
||||
|
||||
//- Density for patch [kg/m^3]
|
||||
virtual tmp<scalarField> rho(const label patchi) const = 0;
|
||||
|
||||
//- Return non-const access to the local density field [kg/m^3]
|
||||
virtual volScalarField& rho();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user