DADummyTurbulenceModel.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2 
3  DAFoam : Discrete Adjoint with OpenFOAM
4  Version : v3
5 
6 \*---------------------------------------------------------------------------*/
7 
9 
10 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
11 
12 namespace Foam
13 {
14 
15 defineTypeNameAndDebug(DADummyTurbulenceModel, 0);
16 addToRunTimeSelectionTable(DATurbulenceModel, DADummyTurbulenceModel, dictionary);
17 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
18 
20  const word modelType,
21  const fvMesh& mesh,
22  const DAOption& daOption)
23  : DATurbulenceModel(modelType, mesh, daOption)
24 {
25 }
26 
27 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
28 // Augmented functions
29 void DADummyTurbulenceModel::correctModelStates(wordList& modelStates) const
30 {
31  /*
32  Description:
33  Update the name in modelStates based on the selected physical model at runtime
34 
35  Example:
36  In DAStateInfo, if the modelStates reads:
37 
38  modelStates = {"nut"}
39 
40  then for the dummyTurbulencemodel, calling correctModelStates(modelStates) will give:
41 
42  modelStates={}
43 
44  We will remove nut from the list!
45  */
46 
47  // remove nut from modelStates
48  DAUtility::listDeleteVal<word>(modelStates, "nut");
49 }
50 
52 {
53  // Do nothing
54 }
55 
57 {
58  // Do nothing
59 }
60 
62 {
63  // Do nothing
64 }
65 
66 void DADummyTurbulenceModel::correctStateResidualModelCon(List<List<word>>& stateCon) const
67 {
68  /*
69  Description:
70  Update the original variable connectivity for the adjoint state
71  residuals in stateCon. Basically, we modify/add state variables based on the
72  original model variables defined in stateCon.
73 
74  Input:
75 
76  stateResCon: the connectivity levels for a state residual, defined in Foam::DAJacCon
77 
78  Example:
79  If stateCon reads:
80  stateCon=
81  {
82  {"U", "p", "nut"},
83  {"p"}
84  }
85 
86  For the dummyTurbulenceModel, calling this function for will get a new stateCon
87  stateCon=
88  {
89  {"U", "p"},
90  {"p"}
91  }
92  */
93 
94  forAll(stateCon, idxI)
95  {
96  DAUtility::listDeleteVal<word>(stateCon[idxI], "nut");
97  }
98 }
99 
100 void DADummyTurbulenceModel::addModelResidualCon(HashTable<List<List<word>>>& allCon) const
101 {
102  // Do nothing
103 }
104 
106 {
107  // Do nothing
108 }
109 
110 void DADummyTurbulenceModel::calcResiduals(const dictionary& options)
111 {
112  // Do nothing
113 }
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 } // End namespace Foam
117 
118 // ************************************************************************* //
Foam::DADummyTurbulenceModel::updateIntermediateVariables
virtual void updateIntermediateVariables()
update any intermediate variables that are dependent on state variables and are used in calcResiduals
Definition: DADummyTurbulenceModel.C:61
forAll
forAll(pseudoP.boundaryField(), patchI)
Definition: solvePseudoPEqn.H:10
Foam::DAOption
Definition: DAOption.H:29
daOption
DAOption daOption(mesh, pyOptions_)
mesh
fvMesh & mesh
Definition: createRefsHeatTransfer.H:4
Foam::DADummyTurbulenceModel::correctModelStates
virtual void correctModelStates(wordList &modelStates) const
update the turbulence state for DAStateInfo::regStates_
Definition: DADummyTurbulenceModel.C:29
DADummyTurbulenceModel.H
Foam::DADummyTurbulenceModel::addModelResidualCon
virtual void addModelResidualCon(HashTable< List< List< word >>> &allCon) const
add the model residual connectivity to stateCon
Definition: DADummyTurbulenceModel.C:100
Foam::DADummyTurbulenceModel::correctNut
virtual void correctNut()
update nut based on other turbulence variables and update the BCs
Definition: DADummyTurbulenceModel.C:51
Foam
Definition: multiFreqScalarFvPatchField.C:144
Foam::DADummyTurbulenceModel::correctStateResidualModelCon
virtual void correctStateResidualModelCon(List< List< word >> &stateCon) const
update the original variable connectivity for the adjoint state residuals in stateCon
Definition: DADummyTurbulenceModel.C:66
Foam::DADummyTurbulenceModel::correct
virtual void correct()
solve the residual equations and update the state
Definition: DADummyTurbulenceModel.C:105
Foam::DADummyTurbulenceModel::DADummyTurbulenceModel
DADummyTurbulenceModel(const word modelType, const fvMesh &mesh, const DAOption &daOption)
Definition: DADummyTurbulenceModel.C:19
Foam::DATurbulenceModel
Definition: DATurbulenceModel.H:61
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(DAFvSource, 0)
Foam::addToRunTimeSelectionTable
addToRunTimeSelectionTable(DAFvSource, DAFvSourceActuatorDisk, dictionary)
Foam::DADummyTurbulenceModel::correctBoundaryConditions
virtual void correctBoundaryConditions()
update turbulence variable boundary values
Definition: DADummyTurbulenceModel.C:56
Foam::DADummyTurbulenceModel::calcResiduals
virtual void calcResiduals(const dictionary &options)
compute the turbulence residuals
Definition: DADummyTurbulenceModel.C:110