Dot-product of symmetric tensors: forum bug fix

This commit is contained in:
Hrvoje Jasak 2011-12-12 16:18:13 +00:00
parent bc9b4612c8
commit bc9513426a
9 changed files with 15 additions and 11 deletions

View file

@ -25,6 +25,7 @@ License
\*---------------------------------------------------------------------------*/
#include "Vector.H"
#include "Tensor.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -185,18 +186,21 @@ inline Vector<Cmpt> operator*(const SymmTensor<Cmpt>& st)
//- Inner-product between two symmetric tensors
template <class Cmpt>
inline SymmTensor<Cmpt>
inline Tensor<Cmpt>
operator&(const SymmTensor<Cmpt>& st1, const SymmTensor<Cmpt>& st2)
{
return SymmTensor<Cmpt>
return Tensor<Cmpt>
(
st1.xx()*st2.xx() + st1.xy()*st2.xy() + st1.xz()*st2.xz(),
st1.xx()*st2.xy() + st1.xy()*st2.yy() + st1.xz()*st2.yz(),
st1.xx()*st2.xz() + st1.xy()*st2.yz() + st1.xz()*st2.zz(),
st1.xy()*st2.xx() + st1.yy()*st2.xy() + st1.yz()*st2.xz(),
st1.xy()*st2.xy() + st1.yy()*st2.yy() + st1.yz()*st2.yz(),
st1.xy()*st2.xz() + st1.yy()*st2.yz() + st1.yz()*st2.zz(),
st1.xz()*st2.xx() + st1.yz()*st2.xy() + st1.zz()*st2.xz(),
st1.xz()*st2.xy() + st1.yz()*st2.yy() + st1.zz()*st2.yz(),
st1.xz()*st2.xz() + st1.yz()*st2.yz() + st1.zz()*st2.zz()
);
}
@ -535,7 +539,7 @@ class innerProduct<SymmTensor<Cmpt>, SymmTensor<Cmpt> >
{
public:
typedef SymmTensor<Cmpt> type;
typedef Tensor<Cmpt> type;
};
template<class Cmpt>

View file

@ -101,7 +101,7 @@ void Foam::EPTT::correct()
==
etaP_/lambda_*twoD
+ twoSymm(C)
- zeta_/2*((tau_ & twoD) + (twoD & tau_))
- zeta_*symm(tau_ & twoD)
- fvm::Sp
(
(1/lambda_)*Foam::exp(epsilon_*lambda_/etaP_*tr(tau_)),

View file

@ -143,7 +143,7 @@ void Foam::Feta_PTT::correct()
==
etaPEff_/lambdaEff_*twoD
+ twoSymm(C)
- zeta_/2*((tau_ & twoD) + (twoD & tau_))
- zeta_*symm(tau_ & twoD)
- fvm::Sp(epsilon_/etaPEff_*tr(tau_) + 1/lambdaEff_, tau_)
);

View file

@ -102,7 +102,7 @@ void Foam::Giesekus::correct()
==
etaP_/lambda_*twoD
+ twoSymm(C)
- (alpha_/etaP_)*(tau_ & tau_)
- (alpha_/etaP_)*symm(tau_ & tau_)
- fvm::Sp(1/lambda_, tau_)
);

View file

@ -103,7 +103,7 @@ void Foam::LPTT::correct()
==
etaP_/lambda_*twoD
+ twoSymm(C)
- zeta_/2*((tau_ & twoD) + (twoD & tau_))
- zeta_*symm(tau_ & twoD)
- fvm::Sp(epsilon_/etaP_*tr(tau_) + 1/lambda_, tau_)
);

View file

@ -130,7 +130,7 @@ void Foam::Leonov::correct()
+ fvm::div(phi(), sigma_)
==
twoSymm(C)
- 1/etaP_/2*((sigma_ & sigma_) - Foam::pow((etaP_/lambda_), 2)*I_)
- 1/etaP_/2*(symm(sigma_ & sigma_) - Foam::pow((etaP_/lambda_), 2)*I_)
+ fvm::Sp
(
1/etaP_/6*

View file

@ -129,7 +129,7 @@ void Foam::S_MDCPP::correct()
==
etaP_/lambdaOb_*twoD
+ twoSymm(C)
- zeta_/2*((tau_ & twoD) + (twoD & tau_))
- zeta_*symm(tau_ & twoD)
- fvm::Sp(1/lambdaOb_*fTau, tau_)
- (
1/lambdaOb_*(etaP_/lambdaOb_/(1 - zeta_)*(fTau - aux)*I_)

View file

@ -154,7 +154,7 @@ void Foam::XPP_DE::correct()
S_
)
- 1/lambdaOb_/Foam::sqr(Lambda_)*
(3*alpha_*Foam::pow(Lambda_, 4)*(S_ & S_) - (1 - alpha_)/3*I_)
(3*alpha_*Foam::pow(Lambda_, 4)*symm(S_ & S_) - (1 - alpha_)/3*I_)
);
SEqn().relax();

View file

@ -133,7 +133,7 @@ void Foam::XPP_SE::correct()
- (
1/lambdaOb_*
(
alpha_*lambdaOb_/etaP_*(tau_ & tau_)
alpha_*lambdaOb_/etaP_*symm(tau_ & tau_)
+ etaP_/lambdaOb_*(fTau - 1)*I_
)
)