adjointOutletVelocityFvPatchVectorField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2007-2020 PCOpt/NTUA
9  Copyright (C) 2013-2020 FOSS GP
10  Copyright (C) 2019 OpenCFD Ltd.
11 -------------------------------------------------------------------------------
12 License
13  This file is part of OpenFOAM.
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 Class
30  Foam::adjointOutletVelocityFvPatchVectorField
31 
32 Description
33  Provides the adjoint outlet velocity values (i.e. adjoint velocity in
34  case of a zeroGradient U boundary condition). Can have stability issues
35  in cases of backflow of the primal velocity.
36  The adjointOutletVelocityFlux should preferably be used.
37 
38 
39 SourceFiles
40  adjointOutletVelocityFvPatchVectorField.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef adjointOutletVelocityFvPatchVectorField_H
45 #define adjointOutletVelocityFvPatchVectorField_H
46 
47 #include "fvPatchFields.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class adjointOutletVelocityFvPatch Declaration
58 \*---------------------------------------------------------------------------*/
59 
61 :
62  public fixedValueFvPatchVectorField,
64 {
65  // Private Member Functions
66 
67  void assignBoundaryValue();
68 
69 
70 public:
71 
72  //- Runtime type information
73  TypeName("adjointOutletVelocity");
74 
75 
76  // Constructors
77 
78  //- Construct from patch and internal field
80  (
81  const fvPatch&,
83  );
84 
85  //- Construct from patch, internal field and dictionary
87  (
88  const fvPatch&,
90  const dictionary&
91  );
92 
93  //- Construct by mapping given adjointOutletVelocityFvPatchVectorField
94  //- onto a new patch
96  (
98  const fvPatch&,
100  const fvPatchFieldMapper&
101  );
102 
103  //- Construct and return a clone
104  virtual tmp<fvPatchVectorField> clone() const
105  {
107  (
109  );
110  }
111 
112  //- Construct as copy setting internal field reference
114  (
117  );
118 
119  //- Construct and return a clone setting internal field reference
121  (
123  ) const
124  {
126  (
128  );
129  }
131 
132 
133  // Member functions
134 
135  //- Return true: Allow adjoint solvers to obtain the outlet phia
136  // value through HbyA
137  virtual bool assignable() const
138  {
139  return true;
140  }
141 
142  //- Update the coefficients associated with the patch field
143  // Apply adjoint BCs through evaluate rather than updateCoeffs
144  // in order to have the correct Ua boundaryField when computing the
145  // adjoint pressure BC
146  virtual void evaluate
147  (
149  );
150 
151  //virtual void updateCoeffs();
152 
153  //- Write
154  virtual void write(Ostream&) const;
155 
156 
157  // Member operators
158 
159  virtual void operator=(const fvPatchField<vector>& pvf);
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
"blocking" : (MPI_Bsend, MPI_Recv)
commsTypes
Communications types.
Definition: UPstream.H:72
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual bool assignable() const
Return true: Allow adjoint solvers to obtain the outlet phia.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
TypeName("adjointOutletVelocity")
Runtime type information.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Update the coefficients associated with the patch field.
A FieldMapper for finite-volume patch fields.
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Provides the adjoint outlet velocity values (i.e. adjoint velocity in case of a zeroGradient U bounda...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
virtual void operator=(const fvPatchField< vector > &pvf)
Base class for solution control classes.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
adjointOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.