26 #ifndef HEATFLUIDCOUPLEDSPECIES_H
27 #define HEATFLUIDCOUPLEDSPECIES_H
33 template<
class NormalForceSpecies>
50 void write(std::ostream& os)
const;
53 void read(std::istream& is);
115 std::array<double,2>
f(
double liquidVolume,
double temperature,
double mass,
double surfaceArea)
const;
166 template<
class NormalForceSpecies>
182 template<
class NormalForceSpecies>
197 template<
class NormalForceSpecies>
201 template<
class NormalForceSpecies>
205 os <<
" massTransferCoefficient " << massTransferCoefficient_;
206 os <<
" latentHeatVaporization " << latentHeatVaporization_;
207 os <<
" liquidDensity " << liquidDensity_;
208 os <<
" evaporationCoefficientA " << evaporationCoefficientA_;
209 os <<
" evaporationCoefficientA " << evaporationCoefficientB_;
210 os <<
" ambientHumidity " << ambientHumidity_;
211 os <<
" ambientEquilibriumMoistureContent " << ambientEquilibriumMoistureContent_;
212 os <<
" ambientVapourConcentration " << ambientVapourConcentration_;
213 os <<
" ambientTemperature " << ambientTemperature_;
216 template<
class NormalForceSpecies>
221 is >> dummy >> massTransferCoefficient_;
222 is >> dummy >> latentHeatVaporization_;
223 is >> dummy >> liquidDensity_;
224 is >> dummy >> evaporationCoefficientA_;
225 is >> dummy >> evaporationCoefficientB_;
226 is >> dummy >> ambientHumidity_;
227 is >> dummy >> ambientEquilibriumMoistureContent_;
228 is >> dummy >> ambientVapourConcentration_;
229 is >> dummy >> ambientTemperature_;
232 template<
class NormalForceSpecies>
235 return "HeatFluidCoupled" + NormalForceSpecies::getBaseName();
238 template<
class NormalForceSpecies>
241 return massTransferCoefficient_;
244 template<
class NormalForceSpecies>
247 logger.assert_always(massTransferCoefficient > 0,
248 "[HeatFluidCoupledSpecies<>::setMassTransferCoefficient(%)] value has to be positive",
249 massTransferCoefficient);
250 massTransferCoefficient_ = massTransferCoefficient;
253 template<
class NormalForceSpecies>
256 return latentHeatVaporization_;
259 template<
class NormalForceSpecies>
262 logger.assert_always(latentHeatVaporization > 0,
263 "[HeatFluidCoupledSpecies<>::setLatentHeatVaporization(%)] value has to be positive",
264 latentHeatVaporization);
265 latentHeatVaporization_ = latentHeatVaporization;
268 template<
class NormalForceSpecies>
271 return liquidDensity_;
274 template<
class NormalForceSpecies>
277 logger.assert_always(liquidDensity > 0,
278 "[HeatFluidCoupledSpecies<>::setLiquidDensity(%)] value has to be positive",
280 liquidDensity_ = liquidDensity;
283 template<
class NormalForceSpecies>
286 return evaporationCoefficientA_;
289 template<
class NormalForceSpecies>
292 logger.assert_always(evaporationCoefficientA >= 0,
293 "[HeatFluidCoupledSpecies<>::setEvaporationCoefficientA(%)] value has to be positive",
294 evaporationCoefficientA);
295 evaporationCoefficientA_ = evaporationCoefficientA;
298 template<
class NormalForceSpecies>
301 return evaporationCoefficientB_;
304 template<
class NormalForceSpecies>
307 logger.assert_always(evaporationCoefficientB <= 0,
308 "[HeatFluidCoupledSpecies<>::setEvaporationCoefficientB(%)] value has to be negative",
309 evaporationCoefficientB);
310 evaporationCoefficientB_ = evaporationCoefficientB;
313 template<
class NormalForceSpecies>
316 return ambientHumidity_;
319 template<
class NormalForceSpecies>
323 logger.assert_always(ambientHumidity > 0,
324 "[HeatFluidCoupledSpecies<>::setAmbientHumidity(%)] value has to be positive",
326 ambientHumidity_ = ambientHumidity;
329 template<
class NormalForceSpecies>
332 return ambientEquilibriumMoistureContent_;
335 template<
class NormalForceSpecies>
338 logger.assert_always(ambientEquilibriumMoistureContent >= 0,
339 "[HeatFluidCoupledSpecies<>::setAmbientEquilibriumMoistureContent(%)] value has to be positive",
340 ambientEquilibriumMoistureContent);
341 ambientEquilibriumMoistureContent_ = ambientEquilibriumMoistureContent;
344 template<
class NormalForceSpecies>
347 return ambientVapourConcentration_;
350 template<
class NormalForceSpecies>
353 logger.assert_always(ambientVapourConcentration >= 0,
354 "[HeatFluidCoupledSpecies<>::setAmbientVapourConcentration(%)] value has to be positive",
355 ambientVapourConcentration);
356 ambientVapourConcentration_ = ambientVapourConcentration;
359 template<
class NormalForceSpecies>
362 return ambientTemperature_;
365 template<
class NormalForceSpecies>
368 logger.assert_always(ambientTemperature > 0,
369 "[HeatFluidCoupledSpecies<>::setAmbientTemperature(%)] value has to be positive",
371 ambientTemperature_ = ambientTemperature;
374 template<
class NormalForceSpecies>
379 double mass = p->getMass();
380 double surfaceArea = p->getSurfaceArea();
382 std::array<double,2> k1 = f(p->getLiquidVolume(),p->getTemperature(), mass, surfaceArea);
384 std::array<double,2> k2 = f(p->getLiquidVolume()+dt*0.5*k1[0],p->getTemperature()+dt*0.5*k1[1], mass, surfaceArea);
385 std::array<double,2> k3 = f(p->getLiquidVolume()+dt*0.5*k2[0],p->getTemperature()+dt*0.5*k2[1], mass, surfaceArea);
386 std::array<double,2> k4 = f(p->getLiquidVolume()+dt*k3[0],p->getTemperature()+dt*k3[1], mass, surfaceArea);
387 double dliquidVolume = dt*(k1[0]+2*k2[0]+2*k3[0]+k4[0])/6.0;
388 double dTemperature = dt*(k1[1]+2*k2[1]+2*k3[1]+k4[1])/6.0;
390 if (p->getLiquidVolume()+dliquidVolume>=0.0) {
391 p->setLiquidVolume(p->getLiquidVolume()+dliquidVolume);
392 p->setTemperature(std::max(0.0,p->getTemperature()+dTemperature));
396 double liquidVolumeToDistribute = - (p->getLiquidVolume()+dliquidVolume);
397 p->setLiquidVolume(0.0);
399 double liquidBridgeVolume = 0.0;
402 liquidBridgeVolume += j->getLiquidBridgeVolume();
405 if (liquidVolumeToDistribute<=liquidBridgeVolume) {
406 double factor = 1.0-liquidVolumeToDistribute/liquidBridgeVolume;
411 p->setTemperature(std::max(0.0,p->getTemperature()+dTemperature));
414 if (liquidBridgeVolume!=0.0) {
415 liquidVolumeToDistribute -= liquidBridgeVolume;
421 double factor = 1.0+liquidVolumeToDistribute/dliquidVolume;
422 p->setTemperature(std::max(0.0,p->getTemperature()+factor*dTemperature));
435 template<
class NormalForceSpecies>
441 double dT = temperature_-273;
442 double saturatedVapourConcentration = dT < 1 ? 8.319815774e-3*temperature_/274 :
443 (((4.844e-9*dT-1.4807e-7)*dT+2.6572e-5)*dT-4.8613e-5)*dT+8.342e-3;
446 double equilibriumActivationEnergy=-
constants::R*getAmbientTemperature()*
log(getAmbientHumidity());
448 double moistureContent = liquidVolume_*getLiquidDensity()/mass;
449 double activationEnergy=equilibriumActivationEnergy*(moistureContent-getAmbientEquilibriumMoistureContent());
453 double interfaceVapourConcentration = temperature_==0?0.0:
454 exp(-activationEnergy/(
constants::R*temperature_))*saturatedVapourConcentration;
457 double dLiquidMass=-getMassTransferCoefficient()*surfaceArea
458 *(interfaceVapourConcentration-getAmbientVapourConcentration());
461 double dLiquidVolume = dLiquidMass/getLiquidDensity();
464 double heatOfEvaporation = getLatentHeatVaporization()*(1.0+getEvaporationCoefficientA()*
exp((getEvaporationCoefficientB()*getLiquidDensity()/mass)*liquidVolume_))*dLiquidMass;
467 double dTemperature = heatOfEvaporation / (mass * this->getHeatCapacity());
469 return {dLiquidVolume, dTemperature};
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
DPMBase * getDPMBase()
Gets the problem that is solved using this handler.
Definition: BaseHandler.h:725
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:60
Definition: BaseParticle.h:54
ParticleHandler * getHandler() const
Returns pointer to the particle's ParticleHandler.
Definition: BaseParticle.cc:673
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1250
Definition: HeatFluidCoupledInteraction.h:38
Species for the HeatFluidCoupledParticle.
Definition: HeatFluidCoupledSpecies.h:35
Mdouble getAmbientVapourConcentration() const
Allows ambientVapourConcentration_ to be accessed.
Definition: HeatFluidCoupledSpecies.h:345
void setEvaporationCoefficientB(Mdouble evaporationCoefficientB)
Allows evaporationCoefficientB_ to be changed.
Definition: HeatFluidCoupledSpecies.h:305
Mdouble getEvaporationCoefficientA() const
Allows evaporationCoefficientA_ to be accessed.
Definition: HeatFluidCoupledSpecies.h:284
Mdouble ambientVapourConcentration_
The ambient vapour concentration (kg/m^3).
Definition: HeatFluidCoupledSpecies.h:157
Mdouble getLiquidDensity() const
Allows liquidDensity_ to be accessed.
Definition: HeatFluidCoupledSpecies.h:269
void setEvaporationCoefficientA(Mdouble evaporationCoefficientA)
Allows evaporationCoefficientA_ to be changed.
Definition: HeatFluidCoupledSpecies.h:290
Mdouble evaporationCoefficientB_
The evaporation coefficient b (dimensionless)
Definition: HeatFluidCoupledSpecies.h:142
HeatFluidCoupledSpecies()
The default constructor.
Definition: HeatFluidCoupledSpecies.h:167
void read(std::istream &is)
Reads the species properties from an input stream.
Definition: HeatFluidCoupledSpecies.h:217
void setAmbientVapourConcentration(Mdouble ambientVapourConcentration)
Allows ambientVapourConcentration_ to be changed.
Definition: HeatFluidCoupledSpecies.h:351
void setMassTransferCoefficient(Mdouble massTransferCoefficient)
Allows massTransferCoefficient_ to be changed.
Definition: HeatFluidCoupledSpecies.h:245
void setLiquidDensity(Mdouble liquidDensity)
Allows liquidDensity_ to be changed.
Definition: HeatFluidCoupledSpecies.h:275
void actionsAfterTimeStep(BaseParticle *particle) const override
Definition: HeatFluidCoupledSpecies.h:375
Mdouble massTransferCoefficient_
The mass transfer rate (m/s)
Definition: HeatFluidCoupledSpecies.h:122
Mdouble ambientHumidity_
The ambient humidity (dimensionless, between 0 and 1, but cannot be 0)
Definition: HeatFluidCoupledSpecies.h:147
void setLatentHeatVaporization(Mdouble latentHeatVaporization)
Allows latentHeatVaporization_ to be changed.
Definition: HeatFluidCoupledSpecies.h:260
Mdouble ambientEquilibriumMoistureContent_
The ambient equilibrium moisture content (dimensionless, between 0 and 1).
Definition: HeatFluidCoupledSpecies.h:152
HeatFluidCoupledInteraction< typename NormalForceSpecies::InteractionType > InteractionType
Definition: HeatFluidCoupledSpecies.h:38
virtual ~HeatFluidCoupledSpecies()
The default destructor.
Definition: HeatFluidCoupledSpecies.h:198
Mdouble evaporationCoefficientA_
The evaporation coefficient a (dimensionless)
Definition: HeatFluidCoupledSpecies.h:137
void write(std::ostream &os) const
Writes the species properties to an output stream.
Definition: HeatFluidCoupledSpecies.h:202
void setAmbientEquilibriumMoistureContent(Mdouble ambientEquilibriumMoistureContent)
Allows ambientEquilibriumMoistureContent_ to be changed.
Definition: HeatFluidCoupledSpecies.h:336
std::array< double, 2 > f(double liquidVolume, double temperature, double mass, double surfaceArea) const
f1 is used in Runge–Kutta method.
Definition: HeatFluidCoupledSpecies.h:436
void setAmbientHumidity(Mdouble ambientHumidity)
Allows ambientHumidity_ to be changed.
Definition: HeatFluidCoupledSpecies.h:320
Mdouble getAmbientHumidity() const
Allows ambientHumidity_ to be accessed.
Definition: HeatFluidCoupledSpecies.h:314
Mdouble getAmbientEquilibriumMoistureContent() const
Allows ambientEquilibriumMoistureContent_ to be accessed.
Definition: HeatFluidCoupledSpecies.h:330
Mdouble latentHeatVaporization_
The latent heat of vaporization (J/kg)
Definition: HeatFluidCoupledSpecies.h:127
Mdouble getEvaporationCoefficientB() const
Allows evaporationCoefficientB_ to be accessed.
Definition: HeatFluidCoupledSpecies.h:299
Mdouble getAmbientTemperature() const
Allows ambientTemperature_ to be accessed.
Definition: HeatFluidCoupledSpecies.h:360
std::string getBaseName() const
Used in Species::getName to obtain a unique name for each Species.
Definition: HeatFluidCoupledSpecies.h:233
Mdouble liquidDensity_
The liquid density (kg/m^3)
Definition: HeatFluidCoupledSpecies.h:132
Mdouble getLatentHeatVaporization() const
Allows latentHeatVaporization_ to be accessed.
Definition: HeatFluidCoupledSpecies.h:254
Mdouble ambientTemperature_
The ambient temperature (K).
Definition: HeatFluidCoupledSpecies.h:162
Mdouble getMassTransferCoefficient() const
Allows massTransferCoefficient_ to be accessed.
Definition: HeatFluidCoupledSpecies.h:239
void setAmbientTemperature(Mdouble ambientTemperature)
Allows ambientTemperature_ to be changed.
Definition: HeatFluidCoupledSpecies.h:366
Class of particles that store both temperature and liquid volume, which is adapted for the CFD-DEM st...
Definition: HeatFluidCoupledParticle.h:46
Defines the liquid bridge willet interaction between two particles or walls.
Definition: LiquidMigrationWilletInteraction.h:45
void setLiquidBridgeVolume(Mdouble liquidBridgeVolume)
Definition: LiquidMigrationWilletInteraction.cc:467
Defines a contact force parallel to the contact normal.
Definition: ThermalSpecies.h:35
void read(std::istream &is)
Reads the species properties from an input stream.
Definition: ThermalSpecies.h:112
void write(std::ostream &os) const
Writes the species properties to an output stream.
Definition: ThermalSpecies.h:104
const Mdouble R
Definition: ExtendedMath.h:50
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
Mdouble log(Mdouble Power)
Definition: ExtendedMath.cc:104
Mdouble exp(Mdouble Exponent)
Definition: ExtendedMath.cc:84