anisotropic.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2022 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::solidThermophysicalTransportModels::anisotropic
26 
27 Description
28  Solid thermophysical transport model for anisotropic thermal conductivity
29 
30  The anisotropic thermal conductivity field is evaluated from the solid
31  material anisotropic kappa specified in the physicalProperties dictionary
32  transformed into the global coordinate system using default
33  coordinate system and optionally additional coordinate systems specified
34  per-zone in the thermophysicalProperties dictionary.
35 
36  If the coordinate transformed kappa does not align exactly with the boundary
37  because the patch face orientations do not conform to the coordinate system
38  exactly it may be beneficial for convergence and accuracy to enforce
39  alignment at the boundary by setting the optional \c boundaryAligned to
40  true.
41 
42 Usage
43  Example of the anisotropic thermal conductivity specification in
44  thermophysicalProperties with two zone-based coordinate systems in
45  addition to the default:
46 
47  \verbatim
48  model anisotropic;
49 
50  // Force aligned handling of kappa irrespective
51  // of the calculated patch alignment factors.
52  boundaryAligned true;
53 
54  // Default coordinate system
55  coordinateSystem
56  {
57  type cartesian;
58  origin (0 0 0);
59  coordinateRotation
60  {
61  type cylindrical;
62  e3 (1 0 0);
63  }
64  }
65 
66  // Optional zone coordinate systems
67  zones
68  {
69  coil1
70  {
71  type cartesian;
72  origin (0.1 0.2 0.7);
73  coordinateRotation
74  {
75  type cylindrical;
76  e3 (0.5 0.866 0);
77  }
78  }
79 
80  coil2
81  {
82  type cartesian;
83  origin (0.4 0.5 1);
84  coordinateRotation
85  {
86  type cylindrical;
87  e3 (0.866 0.5 0);
88  }
89  }
90  }
91  \endverbatim
92 
93 SourceFiles
94  anisotropic.C
95 
96 \*---------------------------------------------------------------------------*/
97 
98 #ifndef anisotropic_H
99 #define anisotropic_H
100 
102 #include "coordinateSystem.H"
103 #include "PtrDictionary.H"
104 #include "MeshObjects.H"
105 
106 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
107 
108 namespace Foam
109 {
110 namespace solidThermophysicalTransportModels
111 {
112 
113 /*---------------------------------------------------------------------------*\
114  Class anisotropic Declaration
115 \*---------------------------------------------------------------------------*/
116 
117 class anisotropic
118 :
120  public UpdateableMeshObject<fvMesh>
121 {
122  // Private member data
123 
124  coordinateSystem coordinateSystem_;
125 
126  //- Optional zone coordinate systems
127  PtrDictionary<coordinateSystem> zoneCoordinateSystems_;
128 
129  //- Switch to override boundary alignment checks
130  // and force aligned handling of kappa irrespective
131  // of the calculated patch alignment factors
132  Switch boundaryAligned_;
133 
134  // List of patch faces adjacent to coordinate zones
135  mutable labelListListList zonesPatchFaces_;
136 
137  //- Alignment of Kappa for each patch
138  // true is closely aligned, zero otherwise
139  boolList aligned_;
140 
141  //- Find all the patch faces adjacent to zones
142  void setZonesPatchFaces() const;
143 
144  //- Thermal conductivity [W/m/K]
145  tmp<volSymmTensorField> Kappa() const;
146 
147  //- Thermal conductivity for patch [W/m/K]
148  tmp<symmTensorField> Kappa(const label patchi) const;
149 
150 
151 public:
152 
153  //- Runtime type information
154  TypeName("anisotropic");
155 
156 
157  // Constructors
158 
159  //- Construct from solid thermophysical properties
161 
162 
163  //- Destructor
164  virtual ~anisotropic()
165  {}
166 
167 
168  // Member Functions
169 
170  //- Read thermophysicalTransport dictionary
171  virtual bool read();
172 
173  //- Thermal conductivity [W/m/K]
174  virtual tmp<volScalarField> kappa() const;
175 
176  //- Thermal conductivity for patch [W/m/K]
177  virtual tmp<scalarField> kappa(const label patchi) const;
178 
179  //- Return the heat flux [W/m^2]
180  virtual tmp<surfaceScalarField> q() const;
181 
182  //- Return the patch heat flux correction [W/m^2]
183  // For patch-aligned thermal conductivity qCorr is null
184  virtual tmp<scalarField> qCorr(const label patchi) const;
185 
186  //- Return the source term for the energy equation
187  virtual tmp<fvScalarMatrix> divq(volScalarField& he) const;
188 
189  //- Correct the anisotropic viscosity
190  virtual void predict();
191 
192 
193  // Mesh changes
194 
195  //- Update for mesh motion
196  virtual bool movePoints();
197 
198  //- Update topology using the given map
199  virtual void topoChange(const polyTopoChangeMap& map);
200 
201  //- Update from another mesh using the given map
202  virtual void mapMesh(const polyMeshMap& map);
203 
204  //- Redistribute or update using the given distribution map
205  virtual void distribute(const polyDistributionMap& map);
206 };
207 
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 } // End namespace solidThermophysicalTransportModels
212 } // End namespace Foam
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 #endif
217 
218 // ************************************************************************* //
Generic GeometricField class.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:61
Base class for other coordinate system specifications.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Base-class for solid thermodynamic properties.
Definition: solidThermo.H:56
Abstract base class for solid thermophysical transport models.
virtual const solidThermo & thermo() const
Access function to solid thermophysical properties.
Solid thermophysical transport model for anisotropic thermal conductivity.
Definition: anisotropic.H:120
virtual bool movePoints()
Update for mesh motion.
Definition: anisotropic.C:450
virtual tmp< scalarField > qCorr(const label patchi) const
Return the patch heat flux correction [W/m^2].
Definition: anisotropic.C:394
virtual void predict()
Correct the anisotropic viscosity.
Definition: anisotropic.C:437
virtual void mapMesh(const polyMeshMap &map)
Update from another mesh using the given map.
Definition: anisotropic.C:467
anisotropic(const solidThermo &thermo)
Construct from solid thermophysical properties.
Definition: anisotropic.C:114
virtual void distribute(const polyDistributionMap &map)
Redistribute or update using the given distribution map.
Definition: anisotropic.C:477
virtual tmp< volScalarField > kappa() const
Thermal conductivity [W/m/K].
Definition: anisotropic.C:360
virtual tmp< surfaceScalarField > q() const
Return the heat flux [W/m^2].
Definition: anisotropic.C:379
virtual void topoChange(const polyTopoChangeMap &map)
Update topology using the given map.
Definition: anisotropic.C:457
virtual bool read()
Read thermophysicalTransport dictionary.
Definition: anisotropic.C:219
virtual tmp< fvScalarMatrix > divq(volScalarField &he) const
Return the source term for the energy equation.
Definition: anisotropic.C:416
TypeName("anisotropic")
Runtime type information.
A class for managing temporary objects.
Definition: tmp.H:55
label patchi
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
thermo he()