DAFvSource.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2 
3  DAFoam : Discrete Adjoint with OpenFOAM
4  Version : v4
5 
6  Description:
7  Compute the source term (e.g., actuator disk) for the primal
8  governing equations
9 
10 \*---------------------------------------------------------------------------*/
11 
12 #ifndef DAFvSource_H
13 #define DAFvSource_H
14 
15 #include "runTimeSelectionTables.H"
16 #include "fvOptions.H"
17 #include "surfaceFields.H"
18 #include "DAOption.H"
19 #include "DAModel.H"
20 #include "DAIndex.H"
21 #include "topoSetSource.H"
22 #include "topoSet.H"
23 #include "regIOobject.H"
24 
25 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
26 
27 namespace Foam
28 {
29 
30 /*---------------------------------------------------------------------------*\
31  Class DAFvSource Declaration
32 \*---------------------------------------------------------------------------*/
33 
35  : public regIOobject
36 {
37 
38 private:
40  DAFvSource(const DAFvSource&);
41 
43  void operator=(const DAFvSource&);
44 
45 protected:
47  const word& modelType_;
48 
50  const fvMesh& mesh_;
51 
54 
56  const DAModel& daModel_;
57 
59  const DAIndex& daIndex_;
60 
61 public:
63  TypeName("DAFvSource");
64 
65  // Declare run-time constructor selection table
67  autoPtr,
68  DAFvSource,
69  dictionary,
70  (const word modelType,
71  const fvMesh& mesh,
72  const DAOption& daOption,
73  const DAModel& daModel,
74  const DAIndex& daIndex),
75  (modelType, mesh, daOption, daModel, daIndex));
76 
77  // Constructors
78 
79  //- Construct from components
80  DAFvSource(
81  const word modelType,
82  const fvMesh& mesh,
83  const DAOption& daOption,
84  const DAModel& daModel,
85  const DAIndex& daIndex);
86 
87  // Selectors
88 
89  //- Return a reference to the selected model
90  static autoPtr<DAFvSource> New(
91  const word modelType,
92  const fvMesh& mesh,
93  const DAOption& daOption,
94  const DAModel& daModel,
95  const DAIndex& daIndex);
96 
97  //- Destructor
98  virtual ~DAFvSource()
99  {
100  }
101 
103  virtual void calcFvSource(volVectorField& fvSource);
104 
106  virtual void calcFvSource(volScalarField& fvSource);
107 
109  virtual void initFvSourcePars();
110 
112  void updateFvSource();
113 
115  bool writeData(Ostream& os) const;
116 
118  label snappedCenterCellI,
119  vector& center);
120 };
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 } // End namespace Foam
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 #endif
129 
130 // ************************************************************************* //
Foam::DAFvSource::writeData
bool writeData(Ostream &os) const
virtual function for regIOobject
Definition: DAFvSource.C:116
Foam::DAFvSource
Definition: DAFvSource.H:34
DAOption.H
Foam::DAFvSource::daOption_
const DAOption & daOption_
DAOption object.
Definition: DAFvSource.H:53
DAIndex.H
Foam::DAOption
Definition: DAOption.H:29
Foam::DAFvSource::calcFvSource
virtual void calcFvSource(volVectorField &fvSource)
compute the FvSource term
Definition: DAFvSource.C:90
Foam::DAFvSource::daIndex_
const DAIndex & daIndex_
DAIndex object.
Definition: DAFvSource.H:59
Foam::DAFvSource::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, DAFvSource, dictionary,(const word modelType, const fvMesh &mesh, const DAOption &daOption, const DAModel &daModel, const DAIndex &daIndex),(modelType, mesh, daOption, daModel, daIndex))
fvSource
volScalarField & fvSource
Definition: createRefsHeatTransfer.H:7
DAModel.H
mesh
fvMesh & mesh
Definition: createRefsHeatTransfer.H:4
Foam::DAFvSource::initFvSourcePars
virtual void initFvSourcePars()
Initialize the values for all types of fvSource in DAGlobalVar, including actuatorDiskPars,...
Definition: DAFvSource.C:126
Foam::DAIndex
Definition: DAIndex.H:32
Foam::DAFvSource::updateFvSource
void updateFvSource()
calculate fvSource based on the latest parameters defined in DAGlobalVar
Definition: DAFvSource.C:163
Foam::DAFvSource::TypeName
TypeName("DAFvSource")
Runtime type information.
Foam::DAFvSource::~DAFvSource
virtual ~DAFvSource()
Definition: DAFvSource.H:98
Foam::DAFvSource::New
static autoPtr< DAFvSource > New(const word modelType, const fvMesh &mesh, const DAOption &daOption, const DAModel &daModel, const DAIndex &daIndex)
Definition: DAFvSource.C:47
Foam::DAModel
Definition: DAModel.H:57
Foam
Definition: checkGeometry.C:32
Foam::DAFvSource::modelType_
const word & modelType_
model name
Definition: DAFvSource.H:47
Foam::DAFvSource::mesh_
const fvMesh & mesh_
fvMesh
Definition: DAFvSource.H:50
Foam::DAFvSource::findGlobalSnappedCenter
void findGlobalSnappedCenter(label snappedCenterCellI, vector &center)
Definition: DAFvSource.C:140
Foam::DAFvSource::daModel_
const DAModel & daModel_
DAModel object.
Definition: DAFvSource.H:56