energyRegionCoupledFvPatchScalarField.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 | Copyright (C) 2012-2013 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::energyRegionCoupledFvPatchScalarField
26 
27 Description
28  Energy region coupled implicit boundary condition.
29  The fvPatch is treated as uncoupled from the delta point of view.
30  In the mesh the fvPatch is an interface and is incorporated
31  into the matrix implicitly.
32 
33 SourceFiles
34  energyRegionCoupledFvPatchScalarField.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef energyRegionCoupledFvPatchScalarField_H
39 #define energyRegionCoupledFvPatchScalarField_H
40 
42 #include "LduInterfaceField.H"
43 #include "fvPatchField.H"
44 #include "NamedEnum.H"
45 #include "basicThermo.H"
46 #include "coupledFvPatchField.H"
47 
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class energyRegionCoupledFvPatchScalarField Declaration
56 \*---------------------------------------------------------------------------*/
57 
59 :
60  public coupledFvPatchField<scalar>
61 {
62 
63 public:
64 
65  enum kappaMethodType
66  {
69  UNDEFINED
70  };
71 
72 
73 private:
74 
75  // Private data
76 
77  //- Local reference to region couple patch
79 
80  //- Methof to extract kappa
82 
83  //- How to get K
84  mutable kappaMethodType method_;
85 
86  //- AutoPtr to nbr thermo
87  mutable const basicThermo* nbrThermoPtr_;
88 
89  //- AutoPtr to my thermo
90  mutable const basicThermo* thermoPtr_;
91 
92 
93  // Private functions
94 
95  //- Local weight for this coupled field
96  tmp<scalarField> weights() const;
97 
98  //- Return nbr temperature internal field
100 
101  //- Return local temperature internal field
103 
104  //- Return kappa
105  tmp<scalarField> kappa() const;
106 
107  //- Set method
108  void setMethod() const;
109 
110 
111 public:
112 
113  //- Runtime type information
114  TypeName("compressible::energyRegionCoupled");
115 
116 
117  // Constructors
118 
119  //- Construct from patch and internal field
121  (
122  const fvPatch&,
124  );
125 
126  //- Construct from patch, internal field and dictionary
128  (
129  const fvPatch&,
131  const dictionary&
132  );
133 
134  //- Construct by mapping given energyRegionCoupledFvPatchScalarField
135  // onto a new patch
137  (
139  const fvPatch&,
141  const fvPatchFieldMapper&
142  );
143 
144  //- Construct as copy
146  (
148  );
149 
150  //- Construct and return a clone
151  virtual tmp<fvPatchField<scalar> > clone() const
152  {
153  return tmp<fvPatchField<scalar> >
154  (
156  );
157  }
158 
159  //- Construct as copy setting internal field reference
161  (
164  );
165 
166  //- Construct and return a clone setting internal field reference
168  (
170  ) const
171  {
172  return tmp<fvPatchField<scalar> >
173  (
175  );
176  }
177 
178 
179  //- Destructor
181  {}
182 
183 
184  // Member functions
185 
186  // Access
187 
188  //- Method to obtain K
189  word kappaMethod() const
190  {
191  return methodTypeNames_[method_];
192  }
193 
194 
195  // Evaluation functions
196 
197  //- Return neighbour coupled internal cell data
198  virtual tmp<scalarField> patchNeighbourField() const;
199 
200  //- Return patch-normal gradient
201  virtual tmp<scalarField> snGrad() const;
202 
203  //- Return patch-normal gradient
204  // Note: the deltaCoeffs supplied are not used
205  virtual tmp<scalarField> snGrad
206  (
207  const scalarField& deltaCoeffs
208  ) const;
209 
210 
211  //- Evaluate the patch field
212  virtual void evaluate
213  (
214  const Pstream::commsTypes commsType
215  );
216 
217 
218  // Coupled interface functionality
219 
220  //- Update result field based on interface functionality
221  virtual void updateInterfaceMatrix
222  (
223  Field<scalar>& result,
224  const scalarField& psiInternal,
225  const scalarField& coeffs,
226  const direction cmpt,
227  const Pstream::commsTypes commsType
228  ) const;
229 
230  //- Update result field based on interface functionality
231  virtual void updateInterfaceMatrix
232  (
233  Field<scalar>&,
234  const Field<scalar>&,
235  const scalarField&,
236  const Pstream::commsTypes commsType
237  ) const;
238 
239  //- Return the interface type
240  virtual const word& interfaceFieldType() const
241  {
243  }
244 
245 
246  //- Write
247  virtual void write(Ostream&) const;
248 };
249 
250 
251 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
252 
253 } // End namespace Foam
254 
255 
256 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
257 
258 #endif
259 
260 // ************************************************************************* //
Foam::energyRegionCoupledFvPatchScalarField::~energyRegionCoupledFvPatchScalarField
virtual ~energyRegionCoupledFvPatchScalarField()
Destructor.
Definition: energyRegionCoupledFvPatchScalarField.H:179
basicThermo.H
Foam::energyRegionCoupledFvPatchScalarField::methodTypeNames_
static const NamedEnum< kappaMethodType, 3 > methodTypeNames_
Methof to extract kappa.
Definition: energyRegionCoupledFvPatchScalarField.H:80
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::energyRegionCoupledFvPatchScalarField::energyRegionCoupledFvPatchScalarField
energyRegionCoupledFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: energyRegionCoupledFvPatchScalarField.C:211
Foam::regionCoupledBaseFvPatch
Base class of regionCoupledFvPatch with common functionality for regionCoupledFvPatch and regionCoupl...
Definition: regionCoupledBaseFvPatch.H:53
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::energyRegionCoupledFvPatchScalarField::method_
kappaMethodType method_
How to get K.
Definition: energyRegionCoupledFvPatchScalarField.H:83
Foam::energyRegionCoupledFvPatchScalarField::patchNeighbourTemperatureField
tmp< scalarField > patchNeighbourTemperatureField() const
Return nbr temperature internal field.
Definition: energyRegionCoupledFvPatchScalarField.C:376
NamedEnum.H
Foam::energyRegionCoupledFvPatchScalarField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType)
Evaluate the patch field.
Definition: energyRegionCoupledFvPatchScalarField.C:318
Foam::basicThermo
Abstract base-class for fluid and solid thermodynamic properties.
Definition: basicThermo.H:52
Foam::energyRegionCoupledFvPatchScalarField::thermoPtr_
const basicThermo * thermoPtr_
AutoPtr to my thermo.
Definition: energyRegionCoupledFvPatchScalarField.H:89
Foam::energyRegionCoupledFvPatchScalarField::nbrThermoPtr_
const basicThermo * nbrThermoPtr_
AutoPtr to nbr thermo.
Definition: energyRegionCoupledFvPatchScalarField.H:86
Foam::energyRegionCoupledFvPatchScalarField::patchInternalTemperatureField
tmp< scalarField > patchInternalTemperatureField() const
Return local temperature internal field.
Definition: energyRegionCoupledFvPatchScalarField.C:395
Foam::energyRegionCoupledFvPatchScalarField::UNDEFINED
@ UNDEFINED
Definition: energyRegionCoupledFvPatchScalarField.H:68
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
regionCoupledBaseFvPatch.H
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::energyRegionCoupledFvPatchScalarField::kappaMethod
word kappaMethod() const
Method to obtain K.
Definition: energyRegionCoupledFvPatchScalarField.H:188
Foam::energyRegionCoupledFvPatchScalarField::weights
tmp< scalarField > weights() const
Local weight for this coupled field.
Definition: energyRegionCoupledFvPatchScalarField.C:149
Foam::energyRegionCoupledFvPatchScalarField::TypeName
TypeName("compressible::energyRegionCoupled")
Runtime type information.
Foam::energyRegionCoupledFvPatchScalarField::SOLID
@ SOLID
Definition: energyRegionCoupledFvPatchScalarField.H:66
Foam::LduInterfaceField< scalar >::updateInterfaceMatrix
virtual void updateInterfaceMatrix(scalarField &, const scalarField &, const scalarField &, const direction, const Pstream::commsTypes commsType) const =0
Inherit updateInterfaceMatrix from lduInterfaceField.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::energyRegionCoupledFvPatchScalarField::clone
virtual tmp< fvPatchField< scalar > > clone() const
Construct and return a clone.
Definition: energyRegionCoupledFvPatchScalarField.H:150
Foam::energyRegionCoupledFvPatchScalarField::regionCoupledPatch_
const regionCoupledBaseFvPatch & regionCoupledPatch_
Local reference to region couple patch.
Definition: energyRegionCoupledFvPatchScalarField.H:77
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:64
Foam::energyRegionCoupledFvPatchScalarField::FLUID
@ FLUID
Definition: energyRegionCoupledFvPatchScalarField.H:67
Foam::energyRegionCoupledFvPatchScalarField::kappa
tmp< scalarField > kappa() const
Return kappa.
Definition: energyRegionCoupledFvPatchScalarField.C:103
Foam::coupledFvPatchField
Abstract base class for coupled patches.
Definition: coupledFvPatchField.H:54
Foam::energyRegionCoupledFvPatchScalarField::setMethod
void setMethod() const
Set method.
Definition: energyRegionCoupledFvPatchScalarField.C:58
LduInterfaceField.H
Foam::energyRegionCoupledFvPatchScalarField
Energy region coupled implicit boundary condition. The fvPatch is treated as uncoupled from the delta...
Definition: energyRegionCoupledFvPatchScalarField.H:57
Foam::direction
unsigned char direction
Definition: direction.H:43
Foam::regionCoupledBaseFvPatch::regionCoupleType
const word & regionCoupleType() const
Return the interface type.
Definition: regionCoupledBaseFvPatch.H:189
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::energyRegionCoupledFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: energyRegionCoupledFvPatchScalarField.C:461
Foam::energyRegionCoupledFvPatchScalarField::patchNeighbourField
virtual tmp< scalarField > patchNeighbourField() const
Return neighbour coupled internal cell data.
Definition: energyRegionCoupledFvPatchScalarField.C:349
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
coupledFvPatchField.H
Foam::energyRegionCoupledFvPatchScalarField::kappaMethodType
kappaMethodType
Definition: energyRegionCoupledFvPatchScalarField.H:64
Foam::NamedEnum< kappaMethodType, 3 >
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::energyRegionCoupledFvPatchScalarField::interfaceFieldType
virtual const word & interfaceFieldType() const
Return the interface type.
Definition: energyRegionCoupledFvPatchScalarField.H:239
fvPatchField.H
Foam::energyRegionCoupledFvPatchScalarField::snGrad
virtual tmp< scalarField > snGrad() const
Return patch-normal gradient.
Definition: energyRegionCoupledFvPatchScalarField.C:300