FreeFOAM The Cross-Platform CFD Toolkit
turbulentTemperatureCoupledBaffleFvPatchScalarField.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) 1991-2010 OpenCFD Ltd.
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  turbulentTemperatureCoupledBaffleFvPatchScalarField
26 
27 Description
28  Harmonic fixed value boundary condition for temperature, to be used
29  for heat-transfer on back-to-back baffles.
30 
31  If my temperature is T1, heat conductivity K1 and neighbour is T2,K2
32 
33  both sides get fixedValue (K1/dx1*T1 + K2/dx2*T2)/(K1/dx1+K2/dx2)
34 
35  Example usage:
36  myInterfacePatchName
37  {
38  type compressible::turbulentTemperatureCoupledBaffle;
39  neighbourFieldName T;
40  K K; // or none
41  value uniform 300;
42  }
43 
44  Needs to be on underlying directMapped(Wall)FvPatch.
45 
46  Note: if K is "none" looks up RASModel and basicThermo, otherwise expects
47  the solver to calculate a 'K' field.
48 
49  Note: runs in parallel with arbitrary decomposition. Uses directMapped
50  functionality to calculate exchange.
51 
52  Note: lags interface data so both sides use same data.
53  - problem: schedule to calculate average would interfere
54  with standard processor swaps.
55  - so: updateCoeffs sets both to same Twall. Only need to do
56  this for last outer iteration but don't have access to this.
57 
58 SourceFiles
59  turbulentTemperatureCoupledBaffleFvPatchScalarField.C
60 
61 \*---------------------------------------------------------------------------*/
62 
63 #ifndef turbulentTemperatureCoupledBaffleFvPatchScalarField_H
64 #define turbulentTemperatureCoupledBaffleFvPatchScalarField_H
65 
67 
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69 
70 namespace Foam
71 {
72 
73 /*---------------------------------------------------------------------------*\
74  Class turbulentTemperatureCoupledBaffleFvPatchScalarField Declaration
75 \*---------------------------------------------------------------------------*/
76 
78 :
79  public fixedValueFvPatchScalarField
80 {
81  // Private data
82 
83  //- Name of field on the neighbour region
84  const word neighbourFieldName_;
85 
86  //- Name of thermal conductivity field
87  const word KName_;
88 
89 
90  // Private Member Functions
91 
92  //- Am I or neighbour owner of interface
93  bool interfaceOwner(const polyMesh&, const polyPatch&) const;
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("compressible::turbulentTemperatureCoupledBaffle");
100 
101 
102  // Constructors
103 
104  //- Construct from patch and internal field
106  (
107  const fvPatch&,
109  );
110 
111  //- Construct from patch, internal field and dictionary
113  (
114  const fvPatch&,
116  const dictionary&
117  );
118 
119  //- Construct by mapping given
120  // turbulentTemperatureCoupledBaffleFvPatchScalarField onto a new patch
122  (
124  const fvPatch&,
126  const fvPatchFieldMapper&
127  );
128 
129  //- Construct and return a clone
131  {
133  (
135  );
136  }
137 
138  //- Construct as copy setting internal field reference
140  (
143  );
144 
145  //- Construct and return a clone setting internal field reference
147  (
149  ) const
150  {
152  (
154  (
155  *this,
156  iF
157  )
158  );
159  }
160 
161 
162  // Member functions
163 
164  //- Get corresponding K field
165  tmp<scalarField> K() const;
166 
167  //- Update the coefficients associated with the patch field
168  virtual void updateCoeffs();
169 
170  //- Write
171  virtual void write(Ostream&) const;
172 };
173 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #endif
182 
183 // ************************************************************************* //