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-------------------------------------------------------------------------------
12License
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
29Class
30 Foam::adjointOutletVelocityFvPatchVectorField
31
32Description
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
39SourceFiles
40 adjointOutletVelocityFvPatchVectorField.C
41
42\*---------------------------------------------------------------------------*/
43
44#ifndef adjointOutletVelocityFvPatchVectorField_H
45#define adjointOutletVelocityFvPatchVectorField_H
46
47#include "fvPatchFields.H"
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace Foam
54{
55
56/*---------------------------------------------------------------------------*\
57 Class adjointOutletVelocityFvPatch Declaration
58\*---------------------------------------------------------------------------*/
61:
62 public fixedValueFvPatchVectorField,
64{
65 // Private Member Functions
66
67 void assignBoundaryValue();
68
69
70public:
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 }
130
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// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
commsTypes
Types of communications.
Definition: UPstream.H:67
Base class for solution control classes.
Provides the adjoint outlet velocity values (i.e. adjoint velocity in case of a zeroGradient U bounda...
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Update the coefficients associated with the patch field.
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
TypeName("adjointOutletVelocity")
Runtime type information.
virtual void operator=(const fvPatchField< vector > &pvf)
virtual bool assignable() const
Return true: Allow adjoint solvers to obtain the outlet phia.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:82
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
A class for managing temporary objects.
Definition: tmp.H:65
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73