externalCoupledMixedFvPatchField.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) 2013-2015 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 Class
27  Foam::externalCoupledMixedFvPatchField
28 
29 Group
30  grpGenericBoundaryConditions grpCoupledBoundaryConditions
31 
32 Description
33  Extends the mixed boundary condition with serialisation functions.
34 
35  The serialisation functions:
36 
37  - writeHeader
38  - writeData
39  - readData
40 
41  It is used for coupling to external applications in combination
42  with the externalCoupled functionObject. The default output is one
43  line per face, with columns
44  \verbatim
45  <value> <snGrad> <refValue> <refGrad> <valueFraction>
46  \endverbatim
47 
48 Note
49  readData, writeData are not callbacks for regIOobject (since fvPatchField
50  not derived from it). They do however do exactly the same - streaming of
51  data.
52 
53 SeeAlso
54  mixedFvPatchField
55  externalCoupledFunctionObject
56 
57 SourceFiles
58  externalCoupledMixedFvPatchField.C
59 
60 \*---------------------------------------------------------------------------*/
61 
62 #ifndef externalCoupledMixedFvPatchField_H
63 #define externalCoupledMixedFvPatchField_H
64 
65 #include "mixedFvPatchFields.H"
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 
72 /*---------------------------------------------------------------------------*\
73  Class externalCoupledMixedFvPatchField Declaration
74 \*---------------------------------------------------------------------------*/
75 
76 template<class Type>
78 :
79  public mixedFvPatchField<Type>
80 {
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("externalCoupled");
86 
87 
88  // Constructors
89 
90  //- Construct from patch and internal field
92  (
93  const fvPatch&,
95  );
96 
97  //- Construct from patch, internal field and dictionary
99  (
100  const fvPatch&,
102  const dictionary&
103  );
104 
105  //- Construct by mapping given externalCoupledMixedFvPatchField
106  // onto a new patch
108  (
110  const fvPatch&,
112  const fvPatchFieldMapper&
113  );
114 
115  //- Construct as copy
117  (
119  );
120 
121  //- Construct as copy setting internal field reference
123  (
126  );
127 
128  //- Return a clone
129  virtual tmp<fvPatchField<Type>> clone() const
130  {
131  return fvPatchField<Type>::Clone(*this);
132  }
133 
134  //- Clone with an internal field reference
136  (
138  ) const
139  {
140  return fvPatchField<Type>::Clone(*this, iF);
141  }
142 
143 
144  //- Destructor
145  virtual ~externalCoupledMixedFvPatchField() = default;
146 
147 
148  // Member functions
149 
150  //- Write header
151  virtual void writeHeader(Ostream& os) const;
152 
153  //- Write data
154  virtual void writeData(Ostream& os) const;
155 
156  //- Read data
157  virtual void readData(Istream& is);
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #ifdef NoRepository
169 #endif
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 #endif
174 
175 // ************************************************************************* //
Extends the mixed boundary condition with serialisation functions.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
This boundary condition provides a base class for &#39;mixed&#39; type boundary conditions, i.e. conditions that mix fixed value and patch-normal gradient conditions.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
TypeName("externalCoupled")
Runtime type information.
virtual tmp< fvPatchField< Type > > clone() const
Return a clone.
A FieldMapper for finite-volume patch fields.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
OBJstream os(runTime.globalPath()/outputName)
virtual ~externalCoupledMixedFvPatchField()=default
Destructor.
externalCoupledMixedFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void writeData(Ostream &os) const
Write data.
virtual void writeHeader(Ostream &os) const
Write header.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.