81 - t.
xx() - t.
yy() - t.
zz();
97 switch (roots.
type(i))
104 <<
"Complex eigenvalues detected for tensor: " << t
116 <<
"Eigenvalue calculation failed for tensor: " << t
151 scalar sd0, sd1, sd2;
152 scalar magSd0, magSd1, magSd2;
155 sd0 =
A.yy()*
A.zz() -
A.yz()*
A.zy();
156 sd1 =
A.zz()*
A.xx() -
A.zx()*
A.xz();
157 sd2 =
A.xx()*
A.yy() -
A.xy()*
A.yx();
163 if (magSd0 >= magSd1 && magSd0 >= magSd2 && magSd0 > small)
168 (
A.yz()*
A.zx() -
A.zz()*
A.yx())/sd0,
169 (
A.zy()*
A.yx() -
A.yy()*
A.zx())/sd0
174 else if (magSd1 >= magSd2 && magSd1 > small)
178 (
A.xz()*
A.zy() -
A.zz()*
A.xy())/sd1,
180 (
A.zx()*
A.xy() -
A.xx()*
A.zy())/sd1
185 else if (magSd2 > small)
189 (
A.xy()*
A.yz() -
A.yy()*
A.xz())/sd2,
190 (
A.yx()*
A.xz() -
A.xx()*
A.yz())/sd2,
198 sd0 =
A.yy()*direction1.
z() -
A.yz()*direction1.
y();
199 sd1 =
A.zz()*direction1.
x() -
A.zx()*direction1.
z();
200 sd2 =
A.xx()*direction1.
y() -
A.xy()*direction1.
x();
206 if (magSd0 >= magSd1 && magSd0 >= magSd2 && magSd0 > small)
211 (
A.yz()*direction1.
x() - direction1.
z()*
A.yx())/sd0,
212 (direction1.
y()*
A.yx() -
A.yy()*direction1.
x())/sd0
217 else if (magSd1 >= magSd2 && magSd1 > small)
221 (direction1.
z()*
A.zy() -
A.zz()*direction1.
y())/sd1,
223 (
A.zx()*direction1.
y() - direction1.
x()*
A.zy())/sd1
228 else if (magSd2 > small)
232 (
A.xy()*direction1.
z() - direction1.
y()*
A.xz())/sd2,
233 (direction1.
x()*
A.xz() -
A.xx()*direction1.
z())/sd2,
241 return direction1^direction2;
247 vector Ux(1, 0, 0), Uy(0, 1, 0), Uz(0, 0, 1);
253 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)