DAObjFuncForce.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2 
3  DAFoam : Discrete Adjoint with OpenFOAM
4  Version : v3
5 
6  Description:
7  Child class for force
8 
9 \*---------------------------------------------------------------------------*/
10 
11 #ifndef DAObjFuncForce_H
12 #define DAObjFuncForce_H
13 
14 #include "DAObjFunc.H"
15 #include "addToRunTimeSelectionTable.H"
16 
17 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
18 
19 namespace Foam
20 {
21 
22 /*---------------------------------------------------------------------------*\
23  Class DAObjFuncForce Declaration
24 \*---------------------------------------------------------------------------*/
25 
27  : public DAObjFunc
28 {
29 
30 protected:
32  vector forceDir_;
33 
35  word dirMode_;
36 
39 
42 
45 
47  void updateForceDir(vector& forceDir);
48 
51 
52 public:
53  TypeName("force");
54  // Constructors
55 
56  //- Construct from components
58  const fvMesh& mesh,
59  const DAOption& daOption,
60  const DAModel& daModel,
61  const DAIndex& daIndex,
62  const DAResidual& daResidual,
63  const word objFuncName,
64  const word objFuncPart,
65  const dictionary& objFuncDict);
66 
67  //- Destructor
68  virtual ~DAObjFuncForce()
69  {
70  }
71 
73  virtual void calcObjFunc(
74  const labelList& objFuncFaceSources,
75  const labelList& objFuncCellSources,
76  scalarList& objFuncFaceValues,
77  scalarList& objFuncCellValues,
78  scalar& objFuncValue);
79 };
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 } // End namespace Foam
84 
85 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
86 
87 #endif
88 
89 // ************************************************************************* //
Foam::DAObjFuncForce
Definition: DAObjFuncForce.H:26
Foam::DAOption
Definition: DAOption.H:29
Foam::DAObjFuncForce::~DAObjFuncForce
virtual ~DAObjFuncForce()
Definition: DAObjFuncForce.H:68
Foam::DAObjFuncForce::flowAxisIndex_
label flowAxisIndex_
flowAxisIndex_ for the alpha design variable with tan(U_normal/U_flow)
Definition: DAObjFuncForce.H:41
Foam::DAObjFuncForce::daTurb_
const DATurbulenceModel & daTurb_
DATurbulenceModel object.
Definition: DAObjFuncForce.H:50
Foam::DAObjFuncForce::DAObjFuncForce
DAObjFuncForce(const fvMesh &mesh, const DAOption &daOption, const DAModel &daModel, const DAIndex &daIndex, const DAResidual &daResidual, const word objFuncName, const word objFuncPart, const dictionary &objFuncDict)
Definition: DAObjFuncForce.C:19
daOption
DAOption daOption(mesh, pyOptions_)
Foam::DAObjFuncForce::forceDir_
vector forceDir_
the direction of the force
Definition: DAObjFuncForce.H:32
Foam::DAObjFuncForce::updateForceDir
void updateForceDir(vector &forceDir)
dynamically adjust the force direction
Definition: DAObjFuncForce.C:196
mesh
fvMesh & mesh
Definition: createRefsHeatTransfer.H:4
Foam::DAObjFuncForce::inoutRefPatchName_
word inoutRefPatchName_
the reference patch name from the alpha design variable dict patches[0] from which we compute the flo...
Definition: DAObjFuncForce.H:38
Foam::DAIndex
Definition: DAIndex.H:32
Foam::DAModel
Definition: DAModel.H:59
Foam
Definition: multiFreqScalarFvPatchField.C:144
Foam::DAResidual
Definition: DAResidual.H:35
Foam::DATurbulenceModel
Definition: DATurbulenceModel.H:61
Foam::DAObjFuncForce::TypeName
TypeName("force")
Foam::DAObjFuncForce::dirMode_
word dirMode_
if dynamically adjusting the angle what mode to use
Definition: DAObjFuncForce.H:35
daModel
DAModel daModel(mesh, daOption)
daIndex
DAIndex daIndex(mesh, daOption, daModel)
DAObjFunc.H
Foam::DAObjFuncForce::normalAxisIndex_
label normalAxisIndex_
normalAxisIndex_ for the alpha design variable with tan(U_normal/U_flow)
Definition: DAObjFuncForce.H:44
Foam::DAObjFuncForce::calcObjFunc
virtual void calcObjFunc(const labelList &objFuncFaceSources, const labelList &objFuncCellSources, scalarList &objFuncFaceValues, scalarList &objFuncCellValues, scalar &objFuncValue)
calculate the value of objective function
Definition: DAObjFuncForce.C:120
Foam::DAObjFunc
Definition: DAObjFunc.H:33