adjointOutletPressureFvPatchScalarField.C
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) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "adjointOutletPressureFvPatchScalarField.H"
30 #include "fvPatchMapper.H"
31 #include "volFields.H"
32 #include "surfaceFields.H"
33 
34 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
35 
38 (
39  const fvPatch& p,
40  const DimensionedField<scalar, volMesh>& iF
41 )
42 :
43  fixedValueFvPatchScalarField(p, iF)
44 {}
45 
46 
49 (
50  const adjointOutletPressureFvPatchScalarField& ptf,
51  const fvPatch& p,
52  const DimensionedField<scalar, volMesh>& iF,
53  const fvPatchFieldMapper& mapper
54 )
55 :
56  fixedValueFvPatchScalarField(ptf, p, iF, mapper)
57 {}
58 
59 
62 (
63  const fvPatch& p,
64  const DimensionedField<scalar, volMesh>& iF,
65  const dictionary& dict
66 )
67 :
68  fixedValueFvPatchScalarField(p, iF, dict)
69 {}
70 
71 
74 (
75  const adjointOutletPressureFvPatchScalarField& tppsf,
76  const DimensionedField<scalar, volMesh>& iF
77 )
78 :
79  fixedValueFvPatchScalarField(tppsf, iF)
80 {}
81 
82 
83 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
84 
86 {
87  if (updated())
88  {
89  return;
90  }
91 
92  const fvsPatchField<scalar>& phip =
93  patch().lookupPatchField<surfaceScalarField, scalar>("phi");
94 
95  const fvsPatchField<scalar>& phiap =
96  patch().lookupPatchField<surfaceScalarField, scalar>("phia");
97 
98  const fvPatchField<vector>& Up =
99  patch().lookupPatchField<volVectorField, vector>("U");
100 
101  const fvPatchField<vector>& Uap =
102  patch().lookupPatchField<volVectorField, vector>("Ua");
103 
104  operator==((phiap/patch().magSf() - 1.0)*phip/patch().magSf() + (Up & Uap));
105 
106  fixedValueFvPatchScalarField::updateCoeffs();
107 }
108 
109 
111 {
113  writeEntry("value", os);
114 }
115 
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 namespace Foam
120 {
122  (
124  adjointOutletPressureFvPatchScalarField
125  );
126 }
127 
128 // ************************************************************************* //
Foam::fvPatchScalarField
fvPatchField< scalar > fvPatchScalarField
Definition: fvPatchFieldsFwd.H:33
volFields.H
Foam::fvPatchField::write
virtual void write(Ostream &) const
Definition: fvPatchField.C:377
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::adjointOutletPressureFvPatchScalarField::adjointOutletPressureFvPatchScalarField
adjointOutletPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Definition: adjointOutletPressureFvPatchScalarField.C:35
surfaceFields.H
Foam::surfaceFields.
fvPatchMapper.H
Foam::adjointOutletPressureFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Definition: adjointOutletPressureFvPatchScalarField.C:91
Foam::operator==
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
dict
dictionary dict
Definition: searchingEngine.H:14
os
OBJstream os(runTime.globalPath()/outputName)
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Definition: atmBoundaryLayer.C:26
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:47
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:58
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:50
Foam::foamVersion::patch
const std::string patch
Foam::makePatchTypeField
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
Foam::adjointOutletPressureFvPatchScalarField::write
virtual void write(Ostream &) const
Definition: adjointOutletPressureFvPatchScalarField.C:154