mySAModel.H
Go to the documentation of this file.
1 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
2 // Get SA member functions
3 
4 // Note: scalar consts are now declared in DAIrkPimpleFoam.H
5 // but fields such as nu, nut, nuTilda, and y still need to be passed as arguments
6 
7 tmp<volScalarField> DAIrkPimpleFoam::chi(
8  volScalarField& nuTilda,
9  const volScalarField& nu)
10 {
11  return nuTilda / nu;
12 }
13 
14 tmp<volScalarField> DAIrkPimpleFoam::fv1(
15  volScalarField& chi)
16 {
17  volScalarField chi3(pow3(chi));
18  return chi3 / (chi3 + pow3(Cv1));
19 }
20 
21 tmp<volScalarField> DAIrkPimpleFoam::fv2(
22  volScalarField& chi,
23  volScalarField& fv1)
24 {
25  return 1.0 / pow3(scalar(1) + chi / Cv2);
26 }
27 
28 tmp<volScalarField> DAIrkPimpleFoam::fv3(
29  volScalarField& chi,
30  volScalarField& fv1)
31 {
32 
33  const volScalarField chiByCv2((1 / Cv2) * chi);
34 
35  return (scalar(1) + chi * fv1)
36  * (1 / Cv2)
37  * (3 * (scalar(1) + chiByCv2) + sqr(chiByCv2))
38  / pow3(scalar(1) + chiByCv2);
39 }
40 
41 tmp<volScalarField> DAIrkPimpleFoam::fw(
42  volScalarField& Stilda,
43  volScalarField& nuTilda,
44  volScalarField& y)
45 {
46  volScalarField r(
47  min(
48  nuTilda
49  / (max(
50  Stilda,
51  dimensionedScalar("SMALL", Stilda.dimensions(), SMALL))
52  * sqr(kappa * y)),
53  scalar(10.0)));
54  r.boundaryFieldRef() == 0.0;
55 
56  // Keep or remove const in adjoint?
57  const volScalarField g(r + Cw2 * (pow6(r) - r));
58 
59  return g * pow((1.0 + pow6(Cw3)) / (pow6(g) + pow6(Cw3)), 1.0 / 6.0);
60 }
61 
62 tmp<volScalarField> DAIrkPimpleFoam::DnuTildaEff(
63  volScalarField& nuTilda,
64  const volScalarField& nu)
65 {
66  return tmp<volScalarField>(
67  new volScalarField("DnuTildaEff", (nuTilda + nu) / sigmaNut));
68 }
69 
71  volScalarField& nut,
72  volScalarField& nuTilda,
73  const volScalarField& nu)
74 {
75  volScalarField chi(this->chi(nuTilda, nu));
76  volScalarField fv1(this->fv1(chi));
77  nut = nuTilda * fv1;
78 
79  nut.correctBoundaryConditions();
80 
81  // Below is in DAFoam, but disabled here
82  // this is basically BasicTurbulenceModel::correctNut();
83  //this->correctAlphat();
84 
85  return;
86 }
87 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
correctNut
correctNut(nut1, nuTilda1, nu)