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 and return a clone
122  virtual tmp<fvPatchField<Type>> clone() const
123  {
124  return tmp<fvPatchField<Type>>
125  (
127  );
128  }
129 
130  //- Construct as copy setting internal field reference
132  (
135  );
136 
137  //- Construct and return a clone setting internal field reference
139  (
141  ) const
142  {
143  return tmp<fvPatchField<Type>>
144  (
146  );
147  }
148 
149 
150  //- Destructor
151  virtual ~externalCoupledMixedFvPatchField() = default;
152 
153 
154  // Member functions
155 
156  //- Write header
157  virtual void writeHeader(Ostream& os) const;
158 
159  //- Write data
160  virtual void writeData(Ostream& os) const;
161 
162  //- Read data
163  virtual void readData(Istream& is);
164 };
165 
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 } // End namespace Foam
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 #ifdef NoRepository
175 #endif
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 #endif
180 
181 // ************************************************************************* //
Foam::externalCoupledMixedFvPatchField::writeData
virtual void writeData(Ostream &os) const
Write data.
Definition: externalCoupledMixedFvPatchField.C:114
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::externalCoupledMixedFvPatchField::writeHeader
virtual void writeHeader(Ostream &os) const
Write header.
Definition: externalCoupledMixedFvPatchField.C:104
Foam::externalCoupledMixedFvPatchField
Extends the mixed boundary condition with serialisation functions.
Definition: externalCoupledMixedFvPatchField.H:76
Foam::externalCoupledMixedFvPatchField::externalCoupledMixedFvPatchField
externalCoupledMixedFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: externalCoupledMixedFvPatchField.C:37
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::mixedFvPatchField
This boundary condition provides a base class for 'mixed' type boundary conditions,...
Definition: mixedFvPatchField.H:123
mixedFvPatchFields.H
Foam::externalCoupledMixedFvPatchField::TypeName
TypeName("externalCoupled")
Runtime type information.
Foam::externalCoupledMixedFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: externalCoupledMixedFvPatchField.H:121
Foam::externalCoupledMixedFvPatchField::readData
virtual void readData(Istream &is)
Read data.
Definition: externalCoupledMixedFvPatchField.C:135
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
externalCoupledMixedFvPatchField.C
Foam::externalCoupledMixedFvPatchField::~externalCoupledMixedFvPatchField
virtual ~externalCoupledMixedFvPatchField()=default
Destructor.
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54