externalCoupledTemperatureMixedFvPatchScalarField.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) 2013-2015 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::externalCoupledTemperatureMixedFvPatchScalarField
26 
27 Group
28  grpCoupledBoundaryConditions
29 
30 Description
31  This boundary condition provides a temperatue interface to an external
32  application. Values are transferred as plain text files, where OpenFOAM
33  data is written as:
34 
35  # Patch: <patch name>
36  <magSf1> <value1> <qDot1> <htc1>
37  <magSf2> <value2> <qDot2> <htc2>
38  <magSf3> <value3> <qDot3> <htc2>
39  ...
40  <magSfN> <valueN> <qDotN> <htcN>
41 
42  and received as the constituent pieces of the `mixed' condition, i.e.
43 
44  # Patch: <patch name>
45  <value1> <gradient1> <valueFracion1>
46  <value2> <gradient2> <valueFracion2>
47  <value3> <gradient3> <valueFracion3>
48  ...
49  <valueN> <gradientN> <valueFracionN>
50 
51  Data is sent/received as a single file for all patches from the directory
52 
53  $FOAM_CASE/<commsDir>
54 
55  At start-up, the boundary creates a lock file, i.e..
56 
57  OpenFOAM.lock
58 
59  ... to signal the external source to wait. During the boundary condition
60  update, boundary values are written to file, e.g.
61 
62  <fileName>.out
63 
64  The lock file is then removed, instructing the external source to take
65  control of the program execution. When ready, the external program
66  should create the return values, e.g. to file
67 
68  <fileName>.in
69 
70  ... and then re-instate the lock file. The boundary condition will then
71  read the return values, and pass program execution back to OpenFOAM.
72 
73  To be used in combination with the externalCoupled functionObject.
74 
75 SeeAlso
76  externalCoupledFunctionObject
77  mixedFvPatchField
78  externalCoupledMixedFvPatchField
79 
80 SourceFiles
81  externalCoupledTemperatureMixedFvPatchScalarField.C
82 
83 \*---------------------------------------------------------------------------*/
84 
85 #ifndef externalCoupledTemperatureMixedFvPatchScalarField_H
86 #define externalCoupledTemperatureMixedFvPatchScalarField_H
87 
89 
90 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
91 
92 namespace Foam
93 {
94 
95 /*---------------------------------------------------------------------------*\
96  Class externalCoupledTemperatureMixedFvPatchScalarField Declaration
97 \*---------------------------------------------------------------------------*/
98 
100 :
101  public externalCoupledMixedFvPatchField<scalar>
102 {
103 
104 public:
105 
106  //- Runtime type information
107  TypeName("externalCoupledTemperature");
108 
109 
110  // Constructors
111 
112  //- Construct from patch and internal field
114  (
115  const fvPatch&,
117  );
118 
119  //- Construct from patch, internal field and dictionary
121  (
122  const fvPatch&,
124  const dictionary&
125  );
126 
127  //- Construct by mapping given
128  // externalCoupledTemperatureMixedFvPatchScalarField onto a new patch
130  (
132  const fvPatch&,
134  const fvPatchFieldMapper&
135  );
136 
137  //- Construct as copy
139  (
141  );
142 
143  //- Construct and return a clone
144  virtual tmp<fvPatchField<scalar> > clone() const
145  {
146  return tmp<fvPatchField<scalar> >
147  (
149  );
150  }
151 
152  //- Construct as copy setting internal field reference
154  (
157  );
158 
159  //- Construct and return a clone setting internal field reference
161  (
163  ) const
164  {
165  return tmp<fvPatchField<scalar> >
166  (
168  (
169  *this,
170  iF
171  )
172  );
173  }
174 
175 
176  //- Destructor
178 
179 
180  // Member functions
181 
182  //- Write header
183  virtual void writeHeader(Ostream&) const;
184 
185  //- Write data
186  virtual void writeData(Ostream&) const;
187 
188  //- Read data
189  virtual void readData(Istream&);
190 };
191 
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 } // End namespace Foam
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 #endif
200 
201 // ************************************************************************* //
externalCoupledMixedFvPatchFields.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::externalCoupledTemperatureMixedFvPatchScalarField::TypeName
TypeName("externalCoupledTemperature")
Runtime type information.
Foam::externalCoupledMixedFvPatchField
This boundary condition extends the mixed boundary condition with serialisation through.
Definition: externalCoupledMixedFvPatchField.H:69
Foam::externalCoupledTemperatureMixedFvPatchScalarField::clone
virtual tmp< fvPatchField< scalar > > clone() const
Construct and return a clone.
Definition: externalCoupledTemperatureMixedFvPatchScalarField.H:143
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::externalCoupledTemperatureMixedFvPatchScalarField::~externalCoupledTemperatureMixedFvPatchScalarField
virtual ~externalCoupledTemperatureMixedFvPatchScalarField()
Destructor.
Definition: externalCoupledTemperatureMixedFvPatchScalarField.C:137
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::externalCoupledTemperatureMixedFvPatchScalarField::writeData
virtual void writeData(Ostream &) const
Write data.
Definition: externalCoupledTemperatureMixedFvPatchScalarField.C:144
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::externalCoupledTemperatureMixedFvPatchScalarField::externalCoupledTemperatureMixedFvPatchScalarField
externalCoupledTemperatureMixedFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: externalCoupledTemperatureMixedFvPatchScalarField.C:47
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::externalCoupledTemperatureMixedFvPatchScalarField::writeHeader
virtual void writeHeader(Ostream &) const
Write header.
Definition: externalCoupledTemperatureMixedFvPatchScalarField.C:35
Foam::externalCoupledTemperatureMixedFvPatchScalarField
This boundary condition provides a temperatue interface to an external application....
Definition: externalCoupledTemperatureMixedFvPatchScalarField.H:98
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::externalCoupledTemperatureMixedFvPatchScalarField::readData
virtual void readData(Istream &)
Read data.
Definition: externalCoupledTemperatureMixedFvPatchScalarField.C:215
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51