revision: v0.14
HeatFluidCoupledSpecies.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2020, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 #ifndef HEATFLUIDCOUPLEDSPECIES_H
27 #define HEATFLUIDCOUPLEDSPECIES_H
28 
29 class BaseInteraction;
30 
31 template<class NormalForceSpecies>
33 {
34 public:
35 
36  // ///\brief The correct Interaction type for this FrictionForceSpecies
37  //typename NormalForceSpecies::InteractionType InteractionType;
38 
41 
44 
46  virtual ~HeatFluidCoupledSpecies();
47 
49  void write(std::ostream& os) const;
50 
52  void read(std::istream& is);
53 
55  std::string getBaseName() const;
56 
58  Mdouble getHeatCapacity() const;
59 
61  void setHeatCapacity(Mdouble heatCapacity);
62 
65 
67  void setThermalConductivity(Mdouble thermalConductivity);
68 
71 
73  void setMassTransferCoefficient(Mdouble massTransferCoefficient);
74 
77 
79  void setLatentHeatVaporization(Mdouble latentHeatVaporization);
80 
82  Mdouble getLiquidDensity() const;
83 
85  void setLiquidDensity(Mdouble liquidDensity);
86 
89 
91  void setEvaporationCoefficientA(Mdouble evaporationCoefficientA);
92 
95 
97  void setEvaporationCoefficientB(Mdouble evaporationCoefficientB);
98 
100  Mdouble getAmbientHumidity() const;
101 
103  void setAmbientHumidity(Mdouble ambientHumidity);
104 
107 
109  void setAmbientEquilibriumMoistureContent(Mdouble ambientEquilibriumMoistureContent);
110 
113 
115  void setAmbientVapourConcentration(Mdouble ambientVapourConcentration);
116 
119 
121  void setAmbientTemperature(Mdouble ambientTemperature);
122 
123 private:
128 
133 
138 
143 
148 
153 
158 
163 
168 
173 
178 
179 };
180 
181 template<class NormalForceSpecies>
184 {
185  heatCapacity_ = 0.0;
186  thermalConductivity_ = 0.0;
189  liquidDensity_=0.0;
192  ambientHumidity_=0.0;
196 }
197 
198 template<class NormalForceSpecies>
200  : NormalForceSpecies(s)
201 {
213 }
214 
215 template<class NormalForceSpecies>
217 {}
218 
219 template<class NormalForceSpecies>
221 {
222  NormalForceSpecies::write(os);
223  os << " heatCapacity " << heatCapacity_;
224  os << " thermalConductivity " << thermalConductivity_;
225  os << " massTransferCoefficient " << massTransferCoefficient_;
226  os << " latentHeatVaporization " << latentHeatVaporization_;
227  os << " liquidDensity " << liquidDensity_;
228  os << " evaporationCoefficientA " << evaporationCoefficientA_;
229  os << " evaporationCoefficientA " << evaporationCoefficientB_;
230  os << " ambientHumidity " << ambientHumidity_;
231  os << " ambientEquilibriumMoistureContent " << ambientEquilibriumMoistureContent_;
232  os << " ambientVapourConcentration " << ambientVapourConcentration_;
233  os << " ambientTemperature " << ambientTemperature_;
234 }
235 
236 template<class NormalForceSpecies>
238 {
239  std::string dummy;
240  NormalForceSpecies::read(is);
241  is >> dummy >> heatCapacity_;
242  is >> dummy >> thermalConductivity_;
243  is >> dummy >> massTransferCoefficient_;
244  is >> dummy >> latentHeatVaporization_;
245  is >> dummy >> liquidDensity_;
246  is >> dummy >> evaporationCoefficientA_;
247  is >> dummy >> evaporationCoefficientB_;
248  is >> dummy >> ambientHumidity_;
249  is >> dummy >> ambientEquilibriumMoistureContent_;
250  is >> dummy >> ambientVapourConcentration_;
251  is >> dummy >> ambientTemperature_;
252 }
253 
254 template<class NormalForceSpecies>
256 {
257  return "HeatFluidCoupled" + NormalForceSpecies::getBaseName();
258 }
259 
260 
261 template<class NormalForceSpecies>
263 {
264  return heatCapacity_;
265 }
266 
267 template<class NormalForceSpecies>
269 {
270  logger.assert_always(heatCapacity > 0,
271  "[HeatFluidCoupledSpecies<>::setHeatCapacity(%)] value has to be positive",
272  heatCapacity);
273  heatCapacity_ = heatCapacity;
274 }
275 
276 template<class NormalForceSpecies>
278 {
279  return thermalConductivity_;
280 }
281 
282 template<class NormalForceSpecies>
284 {
285  logger.assert_always(thermalConductivity >= 0,
286  "[HeatFluidCoupledSpecies<>::setThermalConductivity(%)] value has to be positive",
287  thermalConductivity);
288  thermalConductivity_ = thermalConductivity;
289 }
290 
291 template<class NormalForceSpecies>
293 {
294  return massTransferCoefficient_;
295 }
296 
297 template<class NormalForceSpecies>
299 {
300  logger.assert_always(massTransferCoefficient > 0,
301  "[HeatFluidCoupledSpecies<>::setMassTransferCoefficient(%)] value has to be positive",
302  massTransferCoefficient);
303  massTransferCoefficient_ = massTransferCoefficient;
304 }
305 
306 template<class NormalForceSpecies>
308 {
309  return latentHeatVaporization_;
310 }
311 
312 template<class NormalForceSpecies>
314 {
315  logger.assert_always(latentHeatVaporization > 0,
316  "[HeatFluidCoupledSpecies<>::setLatentHeatVaporization(%)] value has to be positive",
317  latentHeatVaporization);
318  latentHeatVaporization_ = latentHeatVaporization;
319 }
320 
321 template<class NormalForceSpecies>
323 {
324  return liquidDensity_;
325 }
326 
327 template<class NormalForceSpecies>
329 {
330  logger.assert_always(liquidDensity > 0,
331  "[HeatFluidCoupledSpecies<>::setLiquidDensity(%)] value has to be positive",
332  liquidDensity);
333  liquidDensity_ = liquidDensity;
334 }
335 
336 template<class NormalForceSpecies>
338 {
339  return evaporationCoefficientA_;
340 }
341 
342 template<class NormalForceSpecies>
344 {
345  logger.assert_always(evaporationCoefficientA > 0,
346  "[HeatFluidCoupledSpecies<>::setEvaporationCoefficientA(%)] value has to be positive",
347  evaporationCoefficientA);
348  evaporationCoefficientA_ = evaporationCoefficientA;
349 }
350 
351 template<class NormalForceSpecies>
353 {
354  return evaporationCoefficientB_;
355 }
356 
357 template<class NormalForceSpecies>
359 {
360  logger.assert_always(evaporationCoefficientB < 0,
361  "[HeatFluidCoupledSpecies<>::setEvaporationCoefficientB(%)] value has to be negative",
362  evaporationCoefficientB);
363  evaporationCoefficientB_ = evaporationCoefficientB;
364 }
365 
366 template<class NormalForceSpecies>
368 {
369  return ambientHumidity_;
370 }
371 
372 template<class NormalForceSpecies>
374 {
375  logger.assert_always(ambientHumidity > 0,
376  "[HeatFluidCoupledSpecies<>::setAmbientHumidity(%)] value has to be positive",
377  ambientHumidity);
378  ambientHumidity_ = ambientHumidity;
379 }
380 
381 template<class NormalForceSpecies>
383 {
384  return ambientEquilibriumMoistureContent_;
385 }
386 
387 template<class NormalForceSpecies>
389 {
390  logger.assert_always(ambientEquilibriumMoistureContent > 0,
391  "[HeatFluidCoupledSpecies<>::setAmbientEquilibriumMoistureContent(%)] value has to be positive",
392  ambientEquilibriumMoistureContent);
393  ambientEquilibriumMoistureContent_ = ambientEquilibriumMoistureContent;
394 }
395 
396 template<class NormalForceSpecies>
398 {
399  return ambientVapourConcentration_;
400 }
401 
402 template<class NormalForceSpecies>
404 {
405  logger.assert_always(ambientVapourConcentration > 0,
406  "[HeatFluidCoupledSpecies<>::setAmbientVapourConcentration(%)] value has to be positive",
407  ambientVapourConcentration);
408  ambientVapourConcentration_ = ambientVapourConcentration;
409 }
410 
411 template<class NormalForceSpecies>
413 {
414  return ambientTemperature_;
415 }
416 
417 template<class NormalForceSpecies>
419 {
420  logger.assert_always(ambientTemperature > 0,
421  "[HeatFluidCoupledSpecies<>::setAmbientTemperature(%)] value has to be positive",
422  ambientTemperature);
423  ambientTemperature_ = ambientTemperature;
424 }
425 
426 #endif
HeatFluidCoupledSpecies::~HeatFluidCoupledSpecies
virtual ~HeatFluidCoupledSpecies()
The default destructor.
Definition: HeatFluidCoupledSpecies.h:216
HeatFluidCoupledSpecies::setHeatCapacity
void setHeatCapacity(Mdouble heatCapacity)
Allows heatCapacity_ to be changed.
Definition: HeatFluidCoupledSpecies.h:268
HeatFluidCoupledSpecies::getThermalConductivity
Mdouble getThermalConductivity() const
Allows thermalConductivity_ to be accessed.
Definition: HeatFluidCoupledSpecies.h:277
HeatFluidCoupledSpecies::getAmbientEquilibriumMoistureContent
Mdouble getAmbientEquilibriumMoistureContent() const
Allows ambientEquilibriumMoistureContent_ to be accessed.
Definition: HeatFluidCoupledSpecies.h:382
HeatFluidCoupledSpecies::getBaseName
std::string getBaseName() const
Used in Species::getName to obtain a unique name for each Species.
Definition: HeatFluidCoupledSpecies.h:255
HeatFluidCoupledSpecies::HeatFluidCoupledSpecies
HeatFluidCoupledSpecies()
The default constructor.
Definition: HeatFluidCoupledSpecies.h:182
HeatFluidCoupledSpecies::getAmbientHumidity
Mdouble getAmbientHumidity() const
Allows ambientHumidity_ to be accessed.
Definition: HeatFluidCoupledSpecies.h:367
HeatFluidCoupledSpecies::getEvaporationCoefficientA
Mdouble getEvaporationCoefficientA() const
Allows evaporationCoefficientA_ to be accessed.
Definition: HeatFluidCoupledSpecies.h:337
logger
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
HeatFluidCoupledSpecies::heatCapacity_
Mdouble heatCapacity_
The heat capacity.
Definition: HeatFluidCoupledSpecies.h:127
HeatFluidCoupledSpecies::getLiquidDensity
Mdouble getLiquidDensity() const
Allows liquidDensity_ to be accessed.
Definition: HeatFluidCoupledSpecies.h:322
HeatFluidCoupledSpecies::setEvaporationCoefficientB
void setEvaporationCoefficientB(Mdouble evaporationCoefficientB)
Allows evaporationCoefficientB_ to be changed.
Definition: HeatFluidCoupledSpecies.h:358
HeatFluidCoupledSpecies::read
void read(std::istream &is)
Reads the species properties from an input stream.
Definition: HeatFluidCoupledSpecies.h:237
HeatFluidCoupledSpecies::getEvaporationCoefficientB
Mdouble getEvaporationCoefficientB() const
Allows evaporationCoefficientB_ to be accessed.
Definition: HeatFluidCoupledSpecies.h:352
HeatFluidCoupledSpecies
Definition: HeatFluidCoupledSpecies.h:33
HeatFluidCoupledSpecies::setAmbientHumidity
void setAmbientHumidity(Mdouble ambientHumidity)
Allows ambientHumidity_ to be changed.
Definition: HeatFluidCoupledSpecies.h:373
HeatFluidCoupledSpecies::setEvaporationCoefficientA
void setEvaporationCoefficientA(Mdouble evaporationCoefficientA)
Allows evaporationCoefficientA_ to be changed.
Definition: HeatFluidCoupledSpecies.h:343
BaseInteraction
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:60
HeatFluidCoupledSpecies::setAmbientVapourConcentration
void setAmbientVapourConcentration(Mdouble ambientVapourConcentration)
Allows ambientVapourConcentration_ to be changed.
Definition: HeatFluidCoupledSpecies.h:403
HeatFluidCoupledSpecies::setMassTransferCoefficient
void setMassTransferCoefficient(Mdouble massTransferCoefficient)
Allows massTransferCoefficient_ to be changed.
Definition: HeatFluidCoupledSpecies.h:298
NormalForceSpecies
Defines a contact force parallel to the contact normal.
double
HeatFluidCoupledSpecies::ambientVapourConcentration_
Mdouble ambientVapourConcentration_
The ambient vapour concentration.
Definition: HeatFluidCoupledSpecies.h:172
HeatFluidCoupledSpecies::getHeatCapacity
Mdouble getHeatCapacity() const
Allows heatCapacity_ to be accessed.
Definition: HeatFluidCoupledSpecies.h:262
HeatFluidCoupledSpecies::liquidDensity_
Mdouble liquidDensity_
The liquid density.
Definition: HeatFluidCoupledSpecies.h:147
HeatFluidCoupledSpecies::ambientEquilibriumMoistureContent_
Mdouble ambientEquilibriumMoistureContent_
The ambient equilibrium moisture content.
Definition: HeatFluidCoupledSpecies.h:167
HeatFluidCoupledSpecies::massTransferCoefficient_
Mdouble massTransferCoefficient_
The mass transfer coefficient.
Definition: HeatFluidCoupledSpecies.h:137
HeatFluidCoupledSpecies::setAmbientEquilibriumMoistureContent
void setAmbientEquilibriumMoistureContent(Mdouble ambientEquilibriumMoistureContent)
Allows ambientEquilibriumMoistureContent_ to be changed.
Definition: HeatFluidCoupledSpecies.h:388
HeatFluidCoupledSpecies::getLatentHeatVaporization
Mdouble getLatentHeatVaporization() const
Allows latentHeatVaporization_ to be accessed.
Definition: HeatFluidCoupledSpecies.h:307
HeatFluidCoupledSpecies::setThermalConductivity
void setThermalConductivity(Mdouble thermalConductivity)
Allows thermalConductivity_ to be changed.
Definition: HeatFluidCoupledSpecies.h:283
HeatFluidCoupledSpecies::evaporationCoefficientA_
Mdouble evaporationCoefficientA_
The evaporation coefficient a.
Definition: HeatFluidCoupledSpecies.h:152
HeatFluidCoupledSpecies::latentHeatVaporization_
Mdouble latentHeatVaporization_
The latent heat of vaporization.
Definition: HeatFluidCoupledSpecies.h:142
HeatFluidCoupledSpecies::setAmbientTemperature
void setAmbientTemperature(Mdouble ambientTemperature)
Allows ambientTemperature_ to be changed.
Definition: HeatFluidCoupledSpecies.h:418
HeatFluidCoupledSpecies::setLiquidDensity
void setLiquidDensity(Mdouble liquidDensity)
Allows liquidDensity_ to be changed.
Definition: HeatFluidCoupledSpecies.h:328
HeatFluidCoupledSpecies::getAmbientTemperature
Mdouble getAmbientTemperature() const
Allows ambientTemperature_ to be accessed.
Definition: HeatFluidCoupledSpecies.h:412
HeatFluidCoupledSpecies::getAmbientVapourConcentration
Mdouble getAmbientVapourConcentration() const
Allows ambientVapourConcentration_ to be accessed.
Definition: HeatFluidCoupledSpecies.h:397
HeatFluidCoupledSpecies::ambientHumidity_
Mdouble ambientHumidity_
The ambient humidity.
Definition: HeatFluidCoupledSpecies.h:162
HeatFluidCoupledSpecies::thermalConductivity_
Mdouble thermalConductivity_
The thermal conductivity.
Definition: HeatFluidCoupledSpecies.h:132
HeatFluidCoupledSpecies::setLatentHeatVaporization
void setLatentHeatVaporization(Mdouble latentHeatVaporization)
Allows latentHeatVaporization_ to be changed.
Definition: HeatFluidCoupledSpecies.h:313
HeatFluidCoupledSpecies::ambientTemperature_
Mdouble ambientTemperature_
The ambient temperature.
Definition: HeatFluidCoupledSpecies.h:177
HeatFluidCoupledSpecies::write
void write(std::ostream &os) const
Writes the species properties to an output stream.
Definition: HeatFluidCoupledSpecies.h:220
HeatFluidCoupledSpecies::evaporationCoefficientB_
Mdouble evaporationCoefficientB_
The evaporation coefficient b.
Definition: HeatFluidCoupledSpecies.h:157
HeatFluidCoupledSpecies::getMassTransferCoefficient
Mdouble getMassTransferCoefficient() const
Allows massTransferCoefficient_ to be accessed.
Definition: HeatFluidCoupledSpecies.h:292