DAkEpsilon.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2 
3  DAFoam : Discrete Adjoint with OpenFOAM
4  Version : v3
5 
6  This file is modified from OpenFOAM's source code
7  src/TurbulenceModels/turbulenceModels/RAS/kEpsilon/kEpsilon.H
8 
9  OpenFOAM: The Open Source CFD Toolbox
10 
11  Copyright (C): 2011-2016 OpenFOAM Foundation
12 
13  OpenFOAM License:
14 
15  OpenFOAM is free software: you can redistribute it and/or modify it
16  under the terms of the GNU General Public License as published by
17  the Free Software Foundation, either version 3 of the License, or
18  (at your option) any later version.
19 
20  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  for more details.
24 
25  You should have received a copy of the GNU General Public License
26  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27 
28 \*---------------------------------------------------------------------------*/
29 
30 #include "DAkEpsilon.H"
31 
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 
37 defineTypeNameAndDebug(DAkEpsilon, 0);
38 addToRunTimeSelectionTable(DATurbulenceModel, DAkEpsilon, dictionary);
39 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
40 
42  const word modelType,
43  const fvMesh& mesh,
44  const DAOption& daOption)
45  : DATurbulenceModel(modelType, mesh, daOption),
46  // KE parameters
47  Cmu_(dimensioned<scalar>::lookupOrAddToDict(
48  "Cmu",
49  this->coeffDict_,
50  0.09)),
51  C1_(dimensioned<scalar>::lookupOrAddToDict(
52  "C1",
53  this->coeffDict_,
54  1.44)),
55  C2_(dimensioned<scalar>::lookupOrAddToDict(
56  "C2",
57  this->coeffDict_,
58  1.92)),
59  C3_(dimensioned<scalar>::lookupOrAddToDict(
60  "C3",
61  this->coeffDict_,
62  0)),
63  sigmak_(dimensioned<scalar>::lookupOrAddToDict(
64  "sigmak",
65  this->coeffDict_,
66  1.0)),
67  sigmaEps_(dimensioned<scalar>::lookupOrAddToDict(
68  "sigmaEps",
69  this->coeffDict_,
70  1.3)),
71  // Augmented variables
72  epsilon_(const_cast<volScalarField&>(
73  mesh_.thisDb().lookupObject<volScalarField>("epsilon"))),
74  epsilonRes_(
75  IOobject(
76  "epsilonRes",
77  mesh.time().timeName(),
78  mesh,
79  IOobject::NO_READ,
80  IOobject::NO_WRITE),
81  mesh,
82 #ifdef CompressibleFlow
83  dimensionedScalar("epsilonRes", dimensionSet(1, -1, -4, 0, 0, 0, 0), 0.0),
84 #endif
85 #ifdef IncompressibleFlow
86  dimensionedScalar("epsilonRes", dimensionSet(0, 2, -4, 0, 0, 0, 0), 0.0),
87 #endif
88  zeroGradientFvPatchField<scalar>::typeName),
89  k_(const_cast<volScalarField&>(
90  mesh_.thisDb().lookupObject<volScalarField>("k"))),
91  kRes_(
92  IOobject(
93  "kRes",
94  mesh.time().timeName(),
95  mesh,
96  IOobject::NO_READ,
97  IOobject::NO_WRITE),
98  mesh,
99 #ifdef CompressibleFlow
100  dimensionedScalar("kRes", dimensionSet(1, -1, -3, 0, 0, 0, 0), 0.0),
101 #endif
102 #ifdef IncompressibleFlow
103  dimensionedScalar("kRes", dimensionSet(0, 2, -3, 0, 0, 0, 0), 0.0),
104 #endif
105  zeroGradientFvPatchField<scalar>::typeName)
106 {
107 
108  // initialize printInterval_ we need to check whether it is a steady state
109  // or unsteady primal solver
110  IOdictionary fvSchemes(
111  IOobject(
112  "fvSchemes",
113  mesh.time().system(),
114  mesh,
115  IOobject::MUST_READ,
116  IOobject::NO_WRITE,
117  false));
118  word ddtScheme = word(fvSchemes.subDict("ddtSchemes").lookup("default"));
119  if (ddtScheme == "steadyState")
120  {
122  daOption.getAllOptions().lookupOrDefault<label>("printInterval", 100);
123  }
124  else
125  {
127  daOption.getAllOptions().lookupOrDefault<label>("printIntervalUnsteady", 500);
128  }
129 
130  // calculate the size of epsilonWallFunction faces
131  label nWallFaces = 0;
132  forAll(epsilon_.boundaryField(), patchI)
133  {
134  if (epsilon_.boundaryField()[patchI].type() == "epsilonWallFunction"
135  and epsilon_.boundaryField()[patchI].size() > 0)
136  {
137  forAll(epsilon_.boundaryField()[patchI], faceI)
138  {
139  nWallFaces++;
140  //Info<<"patchI: "<<patchI<<" faceI: "<<faceI<<endl;
141  }
142  }
143  }
144 
145  // initialize epsilonNearWall
146  epsilonNearWall_.setSize(nWallFaces);
147 }
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 // KE member functions
152 tmp<fvScalarMatrix> DAkEpsilon::kSource() const
153 {
154  return tmp<fvScalarMatrix>(
155  new fvScalarMatrix(
156  k_,
157  dimVolume * rho_.dimensions() * k_.dimensions()
158  / dimTime));
159 }
160 
161 tmp<fvScalarMatrix> DAkEpsilon::epsilonSource() const
162 {
163  return tmp<fvScalarMatrix>(
164  new fvScalarMatrix(
165  epsilon_,
166  dimVolume * rho_.dimensions() * epsilon_.dimensions()
167  / dimTime));
168 }
169 
170 tmp<volScalarField> DAkEpsilon::DkEff() const
171 {
172  return tmp<volScalarField>(
173  new volScalarField(
174  "DkEff",
175  (nut_ / sigmak_ + this->nu())));
176 }
177 
178 tmp<volScalarField> DAkEpsilon::DepsilonEff() const
179 {
180  return tmp<volScalarField>(
181  new volScalarField(
182  "DepsilonEff",
183  (nut_ / sigmaEps_ + this->nu())));
184 }
185 
186 // Augmented functions
187 void DAkEpsilon::correctModelStates(wordList& modelStates) const
188 {
189  /*
190  Description:
191  Update the name in modelStates based on the selected physical model at runtime
192 
193  Example:
194  In DAStateInfo, if the modelStates reads:
195 
196  modelStates = {"nut"}
197 
198  then for the SA model, calling correctModelStates(modelStates) will give:
199 
200  modelStates={"nuTilda"}
201 
202  while calling correctModelStates(modelStates) for the SST model will give
203 
204  modelStates={"k","epsilon"}
205 
206  We don't udpate the names for the radiation model because users are
207  supposed to set modelStates={"G"}
208  */
209 
210  // For SST model, we need to replace nut with k, epsilon
211 
212  forAll(modelStates, idxI)
213  {
214  word stateName = modelStates[idxI];
215  if (stateName == "nut")
216  {
217  modelStates[idxI] = "epsilon";
218  modelStates.append("k");
219  }
220  }
221 }
222 
224 {
225  /*
226  Description:
227  Update nut based on other turbulence variables and update the BCs
228  Also update alphat if is present
229  */
230 
231  nut_ = Cmu_ * sqr(k_) / epsilon_;
232 
233  nut_.correctBoundaryConditions(); // nutkWallFunction: update wall face nut based on k
234 
235  // this is basically BasicTurbulenceModel::correctNut();
236  this->correctAlphat();
237 
238  return;
239 }
240 
242 {
243  /*
244  Description:
245  Update turbulence variable boundary values
246  */
247 
248  // correct the BCs for the perturbed fields
249  // kqWallFunction is a zero-gradient BC
250  k_.correctBoundaryConditions();
251 }
252 
254 {
255  /*
256  Description:
257  this is a special treatment for epsilon BC because we cant directly call epsilon.
258  correctBoundaryConditions() because it will modify the internal epsilon and G that
259  are right next to walls. This will mess up adjoint Jacobians
260  To solve this issue,
261  1. we store the near wall epsilon before calling epsilon.correctBoundaryConditions()
262  2. call epsilon.correctBoundaryConditions()
263  3. Assign the stored near wall epsilon back
264  4. Apply a zeroGradient BC for epsilon at the wall patches
265  *********** NOTE *************
266  this treatment will obviously downgrade the accuracy of adjoint derivative since it is
267  not 100% consistent with what is used for the flow solver; however, our observation
268  shows that the impact is not very large.
269  */
270 
271  // save the perturbed epsilon at the wall
272  this->saveEpsilonNearWall();
273  // correct epsilon boundary conditions, this includes updating wall face and near wall epsilon values,
274  // updating the inter-proc BCs
275  epsilon_.correctBoundaryConditions();
276  // reset the corrected epsilon near wall cell to its perturbed value
277  this->setEpsilonNearWall();
278 }
279 
281 {
282  /*
283  Description:
284  Save the current near wall epsilon values to epsilonNearWall_
285  */
286  label counterI = 0;
287  forAll(epsilon_.boundaryField(), patchI)
288  {
289  if (epsilon_.boundaryField()[patchI].type() == "epsilonWallFunction"
290  and epsilon_.boundaryField()[patchI].size() > 0)
291  {
292  const UList<label>& faceCells = mesh_.boundaryMesh()[patchI].faceCells();
293  forAll(faceCells, faceI)
294  {
295  //Info<<"Near Wall cellI: "<<faceCells[faceI]<<endl;
296  epsilonNearWall_[counterI] = epsilon_[faceCells[faceI]];
297  counterI++;
298  }
299  }
300  }
301  return;
302 }
303 
305 {
306  /*
307  Description:
308  Set the current near wall epsilon values from epsilonNearWall_
309  Here we also apply a zeroGradient BC to the wall faces
310  */
311  label counterI = 0;
312  forAll(epsilon_.boundaryField(), patchI)
313  {
314  if (epsilon_.boundaryField()[patchI].type() == "epsilonWallFunction"
315  && epsilon_.boundaryField()[patchI].size() > 0)
316  {
317  const UList<label>& faceCells = mesh_.boundaryMesh()[patchI].faceCells();
318  forAll(faceCells, faceI)
319  {
320  epsilon_[faceCells[faceI]] = epsilonNearWall_[counterI];
321  // zeroGradient BC
322  epsilon_.boundaryFieldRef()[patchI][faceI] = epsilon_[faceCells[faceI]];
323  counterI++;
324  }
325  }
326  }
327  return;
328 }
329 
331 {
332  /*
333  Description:
334  Update nut based on nuTilda. Note: we need to update nut and its BC since we
335  may have perturbed other turbulence vars that affect the nut values
336  */
337 
338  this->correctNut();
339 }
340 
341 void DAkEpsilon::correctStateResidualModelCon(List<List<word>>& stateCon) const
342 {
343  /*
344  Description:
345  Update the original variable connectivity for the adjoint state
346  residuals in stateCon. Basically, we modify/add state variables based on the
347  original model variables defined in stateCon.
348 
349  Input:
350 
351  stateResCon: the connectivity levels for a state residual, defined in Foam::DAJacCon
352 
353  Example:
354  If stateCon reads:
355  stateCon=
356  {
357  {"U", "p", "nut"},
358  {"p"}
359  }
360 
361  For the SA turbulence model, calling this function for will get a new stateCon
362  stateCon=
363  {
364  {"U", "p", "nuTilda"},
365  {"p"}
366  }
367 
368  For the SST turbulence model, calling this function will give
369  stateCon=
370  {
371  {"U", "p", "k", "omega"},
372  {"p", "U"}
373  }
374  ***NOTE***: we add a extra level of U connectivity because nut is
375  related to grad(U), k, and omega in SST!
376  */
377 
378  forAll(stateCon, idxI)
379  {
380  forAll(stateCon[idxI], idxJ)
381  {
382  word conStateName = stateCon[idxI][idxJ];
383  if (conStateName == "nut")
384  {
385  stateCon[idxI][idxJ] = "epsilon"; // replace nut with epsilon
386  stateCon[idxI].append("k"); // also add k for that level
387  }
388  }
389  }
390 }
391 
392 void DAkEpsilon::addModelResidualCon(HashTable<List<List<word>>>& allCon) const
393 {
394  /*
395  Description:
396  Add the connectivity levels for all physical model residuals to allCon
397 
398  Input:
399  allCon: the connectivity levels for all state residual, defined in DAJacCon
400 
401  Example:
402  If stateCon reads:
403  allCon=
404  {
405  "URes":
406  {
407  {"U", "p", "nut"},
408  {"p"}
409  }
410  }
411 
412  For the SA turbulence model, calling this function for will get a new stateCon,
413  something like this:
414  allCon=
415  {
416  "URes":
417  {
418  {"U", "p", "nuTilda"},
419  {"p"}
420  },
421  "nuTildaRes":
422  {
423  {"U", "phi", "nuTilda"},
424  {"U"}
425  }
426  }
427 
428  */
429 
430  word pName;
431 
432  if (mesh_.thisDb().foundObject<volScalarField>("p"))
433  {
434  pName = "p";
435  }
436  else if (mesh_.thisDb().foundObject<volScalarField>("p_rgh"))
437  {
438  pName = "p_rgh";
439  }
440  else
441  {
442  FatalErrorIn(
443  "Neither p nor p_rgh was found in mesh.thisDb()!"
444  "addModelResidualCon failed to setup turbulence residuals!")
445  << exit(FatalError);
446  }
447 
448  // NOTE: for compressible flow, it depends on rho so we need to add T and p
449 #ifdef IncompressibleFlow
450  allCon.set(
451  "epsilonRes",
452  {
453  {"U", "epsilon", "k", "phi"}, // lv0
454  {"U", "epsilon", "k"}, // lv1
455  {"U", "epsilon", "k"} // lv2
456  });
457  allCon.set(
458  "kRes",
459  {
460  {"U", "epsilon", "k", "phi"}, // lv0
461  {"U", "epsilon", "k"}, // lv1
462  {"U", "epsilon", "k"} // lv2
463  });
464 #endif
465 
466 #ifdef CompressibleFlow
467  allCon.set(
468  "epsilonRes",
469  {
470  {"U", "T", pName, "epsilon", "k", "phi"}, // lv0
471  {"U", "T", pName, "epsilon", "k"}, // lv1
472  {"U", "T", pName, "epsilon", "k"} // lv2
473  });
474  allCon.set(
475  "kRes",
476  {
477  {"U", "T", pName, "epsilon", "k", "phi"}, // lv0
478  {"U", "T", pName, "epsilon", "k"}, // lv1
479  {"U", "T", pName, "epsilon", "k"} // lv2
480  });
481 #endif
482 }
483 
485 {
486  /*
487  Descroption:
488  Solve the residual equations and update the state. This function will be called
489  by the DASolver. It is needed because we want to control the output frequency
490  of the residual convergence every 100 steps. If using the correct from turbulence
491  it will output residual every step which will be too much of information.
492  */
493 
494  // We set the flag solveTurbState_ to 1 such that in the calcResiduals function
495  // we will solve and update nuTilda
496  solveTurbState_ = 1;
497  dictionary dummyOptions;
498  this->calcResiduals(dummyOptions);
499  // after it, we reset solveTurbState_ = 0 such that calcResiduals will not
500  // update nuTilda when calling from the adjoint class, i.e., solveAdjoint from DASolver.
501  solveTurbState_ = 0;
502 }
503 
504 void DAkEpsilon::calcResiduals(const dictionary& options)
505 {
506  /*
507  Descroption:
508  If solveTurbState_ == 1, this function solve and update k and epsilon, and
509  is the same as calling turbulence.correct(). If solveTurbState_ == 0,
510  this function compute residuals for turbulence variables, e.g., nuTildaRes_
511 
512  Input:
513  options.isPC: 1 means computing residuals for preconditioner matrix.
514  This essentially use the first order scheme for div(phi,nuTilda)
515 
516  p_, U_, phi_, etc: State variables in OpenFOAM
517 
518  Output:
519  kRes_/epsilonRes_: If solveTurbState_ == 0, update the residual field variable
520 
521  k_/epsilon_: If solveTurbState_ == 1, update them
522  */
523 
524  // Copy and modify based on the "correct" function
525 
526  label printToScreen = this->isPrintTime(mesh_.time(), printInterval_);
527 
528  word divKScheme = "div(phi,k)";
529  word divEpsilonScheme = "div(phi,epsilon)";
530 
531  label isPC = 0;
532 
533  if (!solveTurbState_)
534  {
535  isPC = options.getLabel("isPC");
536 
537  if (isPC)
538  {
539  divKScheme = "div(pc)";
540  divEpsilonScheme = "div(pc)";
541  }
542  }
543 
544  // Note: for compressible flow, the "this->phi()" function divides phi by fvc:interpolate(rho),
545  // while for the incompresssible "this->phi()" returns phi only
546  // see src/TurbulenceModels/compressible/compressibleTurbulenceModel.C line 62 to 73
547  volScalarField::Internal divU(
548  fvc::div(fvc::absolute(phi_ / fvc::interpolate(rho_), U_))().v());
549 
550  tmp<volTensorField> tgradU = fvc::grad(U_);
551  volScalarField::Internal G(
552  "kEpsilon:G",
553  nut_.v() * (dev(twoSymm(tgradU().v())) && tgradU().v()));
554  tgradU.clear();
555 
556  if (solveTurbState_)
557  {
558  // Update epsilon and G at the wall
559  epsilon_.boundaryFieldRef().updateCoeffs();
560  }
561  else
562  {
563  // special treatment for epsilon BC
565  }
566 
567  // Dissipation equation
568  tmp<fvScalarMatrix> epsEqn(
569  fvm::ddt(phase_, rho_, epsilon_)
570  + fvm::div(phaseRhoPhi_, epsilon_)
571  - fvm::laplacian(phase_ * rho_ * DepsilonEff(), epsilon_)
572  == C1_ * phase_() * rho_() * G * epsilon_() / k_()
573  - fvm::SuSp((scalar(2.0 / 3.0) * C1_ - C3_) * phase_() * rho_() * divU, epsilon_)
574  - fvm::Sp(C2_ * phase_() * rho_() * epsilon_() / k_(), epsilon_)
575  + epsilonSource());
576 
577  epsEqn.ref().relax();
578 
579  epsEqn.ref().boundaryManipulate(epsilon_.boundaryFieldRef());
580 
581  if (solveTurbState_)
582  {
583 
584  // get the solver performance info such as initial
585  // and final residuals
586  SolverPerformance<scalar> solverEpsilon = solve(epsEqn);
587  if (printToScreen)
588  {
589  Info << "epsilon Initial residual: " << solverEpsilon.initialResidual() << endl
590  << " Final residual: " << solverEpsilon.finalResidual() << endl;
591  }
592 
593  DAUtility::boundVar(allOptions_, epsilon_, printToScreen);
594  }
595  else
596  {
597  // reset the corrected omega near wall cell to its perturbed value
598  this->setEpsilonNearWall();
599 
600  // calculate residuals
601  epsilonRes_ = epsEqn() & epsilon_;
602  // need to normalize residuals
603  normalizeResiduals(epsilonRes);
604  }
605 
606  // Turbulent kinetic energy equation
607  tmp<fvScalarMatrix> kEqn(
608  fvm::ddt(phase_, rho_, k_)
609  + fvm::div(phaseRhoPhi_, k_, divKScheme)
610  - fvm::laplacian(phase_ * rho_ * DkEff(), k_)
611  == phase_() * rho_() * G
612  - fvm::SuSp((2.0 / 3.0) * phase_() * rho_() * divU, k_)
613  - fvm::Sp(phase_() * rho_() * epsilon_() / k_(), k_)
614  + kSource());
615 
616  kEqn.ref().relax();
617 
618  if (solveTurbState_)
619  {
620 
621  // get the solver performance info such as initial
622  // and final residuals
623  SolverPerformance<scalar> solverK = solve(kEqn);
624  if (printToScreen)
625  {
626  Info << "k Initial residual: " << solverK.initialResidual() << endl
627  << " Final residual: " << solverK.finalResidual() << endl;
628  }
629 
630  DAUtility::boundVar(allOptions_, k_, printToScreen);
631 
632  this->correctNut();
633  }
634  else
635  {
636  // calculate residuals
637  kRes_ = kEqn() & k_;
638  // need to normalize residuals
639  normalizeResiduals(kRes);
640  }
641 
642  return;
643 }
644 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
645 
646 } // End namespace Foam
647 
648 // ************************************************************************* //
Foam::DAkEpsilon::DkEff
tmp< volScalarField > DkEff() const
Definition: DAkEpsilon.C:170
Foam::DAkEpsilon::epsilonNearWall_
scalarList epsilonNearWall_
Definition: DAkEpsilon.H:96
Foam::DAkEpsilon::Cmu_
dimensionedScalar Cmu_
Definition: DAkEpsilon.H:55
forAll
forAll(pseudoP.boundaryField(), patchI)
Definition: solvePseudoPEqn.H:10
Foam::DATurbulenceModel::phi_
surfaceScalarField & phi_
face flux
Definition: DATurbulenceModel.H:89
Foam::DAkEpsilon::addModelResidualCon
virtual void addModelResidualCon(HashTable< List< List< word >>> &allCon) const
add the model residual connectivity to stateCon
Definition: DAkEpsilon.C:392
Foam::DAkEpsilon::epsilon_
volScalarField & epsilon_
Definition: DAkEpsilon.H:86
Foam::DAOption
Definition: DAOption.H:29
Foam::DAkEpsilon::correctBoundaryConditions
virtual void correctBoundaryConditions()
update turbulence variable boundary values
Definition: DAkEpsilon.C:241
daOption
DAOption daOption(mesh, pyOptions_)
Foam::DAkEpsilon::correct
virtual void correct()
solve the residual equations and update the state
Definition: DAkEpsilon.C:484
Foam::DAkEpsilon::calcResiduals
virtual void calcResiduals(const dictionary &options)
compute the turbulence residuals
Definition: DAkEpsilon.C:504
normalizeResiduals
#define normalizeResiduals(resName)
Definition: DAMacroFunctions.H:28
Foam::DATurbulenceModel::phaseRhoPhi_
surfaceScalarField & phaseRhoPhi_
phase*phi*density field
Definition: DATurbulenceModel.H:95
Foam::DATurbulenceModel::allOptions_
const dictionary & allOptions_
all DAFoam options
Definition: DATurbulenceModel.H:80
Foam::DAkEpsilon::printInterval_
label printInterval_
time step interval to print residual
Definition: DAkEpsilon.H:102
mesh
fvMesh & mesh
Definition: createRefsHeatTransfer.H:4
Foam::DAUtility::boundVar
static void boundVar(const dictionary &allOptions, volScalarField &var, const label printToScreen)
bound a volScalar variable based on parametes defined in DAOption::allOptions_
Definition: DAUtility.C:419
Foam::DAkEpsilon::correctModelStates
virtual void correctModelStates(wordList &modelStates) const
update the turbulence state for DAStateInfo::regStates_
Definition: DAkEpsilon.C:187
Foam::DATurbulenceModel::U_
volVectorField & U_
velocity
Definition: DATurbulenceModel.H:86
Foam::DATurbulenceModel::nut_
volScalarField & nut_
turbulence viscosity
Definition: DATurbulenceModel.H:83
Foam::DAkEpsilon::sigmaEps_
dimensionedScalar sigmaEps_
Definition: DAkEpsilon.H:60
Foam::DAkEpsilon::epsilonRes_
volScalarField epsilonRes_
Definition: DAkEpsilon.H:87
Foam
Definition: multiFreqScalarFvPatchField.C:144
Foam::DAkEpsilon::C1_
dimensionedScalar C1_
Definition: DAkEpsilon.H:56
Foam::DATurbulenceModel::nu
tmp< volScalarField > nu() const
get the nu field
Definition: DATurbulenceModel.C:262
Foam::DAkEpsilon::kSource
tmp< fvScalarMatrix > kSource() const
Definition: DAkEpsilon.C:152
Foam::DAkEpsilon::correctEpsilonBoundaryConditions
void correctEpsilonBoundaryConditions()
specially treatment to correct epsilon BC
Definition: DAkEpsilon.C:253
Foam::DAkEpsilon::setEpsilonNearWall
void setEpsilonNearWall()
set epsilonNearWall_ to near wall epsilon values
Definition: DAkEpsilon.C:304
Foam::DAkEpsilon::C3_
dimensionedScalar C3_
Definition: DAkEpsilon.H:58
Foam::DATurbulenceModel::correctAlphat
void correctAlphat()
update alphat
Definition: DATurbulenceModel.C:206
Foam::DAkEpsilon::correctNut
virtual void correctNut()
update nut based on other turbulence variables and update the BCs
Definition: DAkEpsilon.C:223
Foam::DAkEpsilon::k_
volScalarField & k_
Definition: DAkEpsilon.H:88
Foam::DAkEpsilon::epsilonSource
tmp< fvScalarMatrix > epsilonSource() const
Definition: DAkEpsilon.C:161
Foam::DAkEpsilon::kRes_
volScalarField kRes_
Definition: DAkEpsilon.H:89
solve
pseudoPEqn solve(solverDictP_)
Foam::DATurbulenceModel
Definition: DATurbulenceModel.H:61
Foam::DAkEpsilon::correctStateResidualModelCon
virtual void correctStateResidualModelCon(List< List< word >> &stateCon) const
update the original variable connectivity for the adjoint state residuals in stateCon
Definition: DAkEpsilon.C:341
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(DAFvSource, 0)
Foam::addToRunTimeSelectionTable
addToRunTimeSelectionTable(DAFvSource, DAFvSourceActuatorDisk, dictionary)
Foam::DATurbulenceModel::mesh_
const fvMesh & mesh_
fvMesh
Definition: DATurbulenceModel.H:74
Foam::DAkEpsilon::DAkEpsilon
DAkEpsilon(const word modelType, const fvMesh &mesh, const DAOption &daOption)
Definition: DAkEpsilon.C:41
Foam::DATurbulenceModel::isPrintTime
label isPrintTime(const Time &runTime, const label printInterval) const
Definition: DATurbulenceModel.C:464
Foam::DAkEpsilon::saveEpsilonNearWall
void saveEpsilonNearWall()
save near wall epsilon values to epsilonNearWall_
Definition: DAkEpsilon.C:280
Foam::DAkEpsilon::updateIntermediateVariables
virtual void updateIntermediateVariables()
update any intermediate variables that are dependent on state variables and are used in calcResiduals
Definition: DAkEpsilon.C:330
Foam::DAkEpsilon::solveTurbState_
label solveTurbState_
whether to solve for turb states
Definition: DAkEpsilon.H:99
DAkEpsilon.H
Foam::DAkEpsilon::sigmak_
dimensionedScalar sigmak_
Definition: DAkEpsilon.H:59
Foam::DAkEpsilon::DepsilonEff
tmp< volScalarField > DepsilonEff() const
Definition: DAkEpsilon.C:178
Foam::DAkEpsilon::C2_
dimensionedScalar C2_
Definition: DAkEpsilon.H:57
Foam::DATurbulenceModel::phase_
volScalarField phase_
phase field
Definition: DATurbulenceModel.H:92