78 - t.
xx() - t.
yy() - t.
zz();
94 switch (roots.
type(i))
101 <<
"Complex eigenvalues detected for tensor: " << t
113 <<
"Eigenvalue calculation failed for tensor: " << t
148 scalar sd0, sd1, sd2;
149 scalar magSd0, magSd1, magSd2;
152 sd0 =
A.yy()*
A.zz() -
A.yz()*
A.zy();
153 sd1 =
A.zz()*
A.xx() -
A.zx()*
A.xz();
154 sd2 =
A.xx()*
A.yy() -
A.xy()*
A.yx();
160 if (magSd0 >= magSd1 && magSd0 >= magSd2 && magSd0 > small)
165 (
A.yz()*
A.zx() -
A.zz()*
A.yx())/sd0,
166 (
A.zy()*
A.yx() -
A.yy()*
A.zx())/sd0
171 else if (magSd1 >= magSd2 && magSd1 > small)
175 (
A.xz()*
A.zy() -
A.zz()*
A.xy())/sd1,
177 (
A.zx()*
A.xy() -
A.xx()*
A.zy())/sd1
182 else if (magSd2 > small)
186 (
A.xy()*
A.yz() -
A.yy()*
A.xz())/sd2,
187 (
A.yx()*
A.xz() -
A.xx()*
A.yz())/sd2,
195 sd0 =
A.yy()*direction1.
z() -
A.yz()*direction1.
y();
196 sd1 =
A.zz()*direction1.
x() -
A.zx()*direction1.
z();
197 sd2 =
A.xx()*direction1.
y() -
A.xy()*direction1.
x();
203 if (magSd0 >= magSd1 && magSd0 >= magSd2 && magSd0 > small)
208 (
A.yz()*direction1.
x() - direction1.
z()*
A.yx())/sd0,
209 (direction1.
y()*
A.yx() -
A.yy()*direction1.
x())/sd0
214 else if (magSd1 >= magSd2 && magSd1 > small)
218 (direction1.
z()*
A.zy() -
A.zz()*direction1.
y())/sd1,
220 (
A.zx()*direction1.
y() - direction1.
x()*
A.zy())/sd1
225 else if (magSd2 > small)
229 (
A.xy()*direction1.
z() - direction1.
y()*
A.xz())/sd2,
230 (direction1.
x()*
A.xz() -
A.xx()*direction1.
z())/sd2,
238 return direction1^direction2;
244 vector Ux(1, 0, 0), Uy(0, 1, 0), Uz(0, 0, 1);
250 return tensor(Ux, Uy, Uz);
static const Foam::dimensionedScalar A("A", Foam::dimPressure, 611.21)
#define forAll(list, i)
Loop across all elements in list.
Templated storage for the roots of polynomial equations, plus flags to indicate the nature of the roo...
void type(const direction i, const rootType t)
Set the type of the i-th root.
static const char *const componentNames[]
static const Form rootMax
static const Form rootMin
static Form uniform(const Cmpt &s)
Return a VectorSpace with all elements = s.
static const char *const typeName
Cubic equation of the form a*x^3 + b*x^2 + c*x + d = 0.
Roots< 3 > roots() const
Get the roots.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedScalar lambda(viscosity->lookup("lambda"))
#define WarningInFunction
Report a warning using Foam::Warning.
const dimensionedScalar c
Speed of light in a vacuum.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensionedTensor eigenVectors(const dimensionedTensor &dt)
Tensor< scalar > tensor
Tensor of scalars.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static const Identity< scalar > I
dimensioned< scalar > mag(const dimensioned< Type > &)
dimensionedVector eigenValues(const dimensionedTensor &dt)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
vector eigenVector(const tensor &T, const scalar lambda, const vector &direction1, const vector &direction2)