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 as copy setting internal field reference
105  (
108  );
109 
110  //- Return a clone
111  virtual tmp<fvPatchField<vector>> clone() const
112  {
113  return fvPatchField<vector>::Clone(*this);
114  }
115 
116  //- Clone with an internal field reference
118  (
120  ) const
121  {
122  return fvPatchField<vector>::Clone(*this, iF);
123  }
124 
125 
126  // Member functions
128  //- Return true: Allow adjoint solvers to obtain the outlet phia
129  // value through HbyA
130  virtual bool assignable() const
131  {
132  return true;
133  }
134 
135  //- Update the coefficients associated with the patch field
136  // Apply adjoint BCs through evaluate rather than updateCoeffs
137  // in order to have the correct Ua boundaryField when computing the
138  // adjoint pressure BC
139  virtual void evaluate
140  (
142  );
143 
144  //virtual void updateCoeffs();
145 
146  //- Write
147  virtual void write(Ostream&) const;
148 
149 
150  // Member operators
151 
152  virtual void operator=(const fvPatchField<vector>& pvf);
153 };
154 
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #endif
163 
164 // ************************************************************************* //
commsTypes
Communications types.
Definition: UPstream.H:77
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
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Update the coefficients associated with the patch field.
TypeName("adjointOutletVelocity")
Runtime type information.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
A FieldMapper for finite-volume patch fields.
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...
virtual tmp< fvPatchField< vector > > clone() const
Return a clone.
adjointOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
"buffered" : (MPI_Bsend, MPI_Recv)
Namespace for OpenFOAM.