ThermoParcelTrackingDataI.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) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 template<class ParcelType>
30 template<class TrackCloudType>
32 (
33  const TrackCloudType& cloud,
34  trackPart part
35 )
36 :
37  ParcelType::trackingData(cloud, part),
38  Cp_(cloud.thermo().thermo().Cp()),
39  kappa_(cloud.thermo().thermo().kappa()),
40  TInterp_
41  (
42  interpolation<scalar>::New
43  (
44  cloud.solution().interpolationSchemes(),
45  cloud.T()
46  )
47  ),
48  CpInterp_
49  (
50  interpolation<scalar>::New
51  (
52  cloud.solution().interpolationSchemes(),
53  Cp_
54  )
55  ),
56  kappaInterp_
57  (
58  interpolation<scalar>::New
59  (
60  cloud.solution().interpolationSchemes(),
61  kappa_
62  )
63  ),
64  GInterp_(nullptr),
65  Tc_(Zero),
66  Cpc_(Zero)
67 {
68  if (cloud.radiation())
69  {
70  GInterp_.reset
71  (
73  (
74  cloud.solution().interpolationSchemes(),
75  cloud.mesh().objectRegistry::template
76  lookupObject<volScalarField>("G")
77  ).ptr()
78  );
79  }
80 }
81 
82 
83 template<class ParcelType>
84 inline const Foam::volScalarField&
86 {
87  return Cp_;
88 }
89 
90 
91 template<class ParcelType>
92 inline const Foam::volScalarField&
94 {
95  return kappa_;
96 }
97 
98 
99 template<class ParcelType>
102 {
103  return *TInterp_;
104 }
105 
106 
107 template<class ParcelType>
110 {
111  return *CpInterp_;
112 }
113 
114 
115 template<class ParcelType>
118 {
119  return *kappaInterp_;
120 }
121 
122 
123 template<class ParcelType>
126 {
127  if (!GInterp_)
128  {
130  << "Radiation G interpolation object not set"
131  << abort(FatalError);
132  }
133 
134  return *GInterp_;
135 }
136 
137 
138 template<class ParcelType>
140 {
141  return Tc_;
142 }
143 
144 
145 template<class ParcelType>
147 {
148  return Tc_;
149 }
150 
151 
152 template<class ParcelType>
154 {
155  return Cpc_;
156 }
157 
158 
159 template<class ParcelType>
161 {
162  return Cpc_;
163 }
164 
165 
166 // ************************************************************************* //
ParcelType::trackingData::trackPart trackPart
Definition: ThermoParcel.H:248
const interpolation< scalar > & kappaInterp() const
Return const access to the interpolator for continuous.
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
scalar Cp_
Specific heat capacity [J/(kg.K)].
Definition: ThermoParcel.H:339
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:598
trackingData(const TrackCloudType &cloud, trackPart part=ParcelType::trackingData::tpLinearTrack)
Construct from components.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
const volScalarField & kappa() const
Return access to the locally stored carrier kappa field.
const interpolation< scalar > & GInterp() const
Return const access to the interpolator for continuous.
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
const interpolation< scalar > & TInterp() const
Return const access to the interpolator for continuous.
A cloud is a registry collection of lagrangian particles.
Definition: cloud.H:53
errorManip< error > abort(error &err)
Definition: errorManip.H:139
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
const volScalarField & Cp
Definition: EEqn.H:7
scalar Tc() const
Return the continuous phase temperature.
const volScalarField & T
const interpolation< scalar > & CpInterp() const
Return const access to the interpolator for continuous.
scalar Cpc() const
Return the continuous phase specific heat capacity.
Abstract base class for volume field interpolation.
const volScalarField & Cp() const
Return access to the locally stored carrier Cp field.
Selector class for relaxation factors, solver type and solution.
Definition: solution.H:92
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127