ECOGEN 6.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
Mixture.h
Go to the documentation of this file.
1//
2// ,---. ,--, .---. ,--, ,---. .-. .-.
3// | .-' .' .') / .-. ) .' .' | .-' | \| |
4// | `-. | |(_) | | |(_) | | __ | `-. | | |
5// | .-' \ \ | | | | \ \ ( _) | .-' | |\ |
6// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)|
7// /( __.' \____\ )---' )\____/ /( __.' /( (_)
8// (__) (_) (__) (__) (__)
9// Official webSite: https://code-mphi.github.io/ECOGEN/
10//
11// This file is part of ECOGEN.
12//
13// ECOGEN is the legal property of its developers, whose names
14// are listed in the copyright file included with this source
15// distribution.
16//
17// ECOGEN is free software: you can redistribute it and/or modify
18// it under the terms of the GNU General Public License as published
19// by the Free Software Foundation, either version 3 of the License,
20// or (at your option) any later version.
21//
22// ECOGEN is distributed in the hope that it will be useful,
23// but WITHOUT ANY WARRANTY; without even the implied warranty of
24// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25// GNU General Public License for more details.
26//
27// You should have received a copy of the GNU General Public License
28// along with ECOGEN (file LICENSE).
29// If not, see <http://www.gnu.org/licenses/>.
30
31#ifndef MIXTURE_H
32#define MIXTURE_H
33
34#include <vector>
35
36class Mixture;
37
39
43{
44 public:
45 Mixture();
46 virtual ~Mixture();
49 void printMixture(std::ofstream& fileStream) const;
50
57 //virtual double computeTsat(const Eos* eosLiq, const Eos* eosVap, const double& pressure, double* dTsat=0) { Errors::errorMessage("computeTsat not available for requested mixture"); return 0.; };
58 double computeTsat(const Eos* eosLiq, const Eos* eosVap, const double& pressure, double* dTsat = 0);
64 double computePsat(const Eos* eosLiq, const Eos* eosVap, const double& temp);
65
69 double computeCriticalPressure(const Eos* eosLiq, const Eos* eosVap);
70
73 virtual void allocateAndCopyMixture(Mixture** /*mixture*/)
74 {
75 Errors::errorMessage("allocateAndCopyMixture not available for requested mixture");
76 };
77
79 virtual void copyMixture(Mixture& /*mixture*/) { Errors::errorMessage("copyMixture not available for requested mixture"); };
84 virtual double computeDensity(const double* /*alphak*/, const double* /*rhok*/)
85 {
86 Errors::errorMessage("computeDensity not available for requested mixture");
87 return 0.;
88 };
89
93 virtual double computePressure(const double* /*alphak*/, const double* /*pk*/)
94 {
95 Errors::errorMessage("computePressure not available for requested mixture");
96 return 0.;
97 };
98 virtual double computePressure(double* /*masses*/, const double& /*mixInternalEnerg*/, Phase** /*phases*/)
99 {
100 Errors::errorMessage("computePressure not available for requested mixture");
101 return 0.;
102 };
103 virtual double computePressure(
104 double /*mass*/, const double& /*internalEnergy*/, Phase** /*phases*/, Mixture* /*mixture*/, const int& /*liq*/, const int& /*vap*/)
105 {
106 Errors::errorMessage("computePressure not available for requested mixture");
107 return 0.;
108 };
109
113 virtual double computeVelocity(const double* /*Yk*/, const double* /*uk*/)
114 {
115 Errors::errorMessage("computeVelocity not available for requested mixture");
116 return 0.;
117 };
118 virtual double computeTemperature(double* /*masses*/, const double& /*pressure*/, Phase** /*phases*/)
119 {
120 Errors::errorMessage("computeTemperature not available for requested mixture");
121 return 0.;
122 };
123
127 virtual double computeInternalEnergy(const double* /*Yk*/, const double* /*ek*/)
128 {
129 Errors::errorMessage("computeInternalEnergy not available for requested mixture");
130 return 0.;
131 };
132
136 virtual double computeFrozenSoundSpeed(const double* /*Yk*/, const double* /*ck*/)
137 {
138 Errors::errorMessage("computeFrozenSoundSpeed not available for requested mixture");
139 return 0.;
140 };
141
150 const std::vector<double>& /*Yk*/, const double& /*p0*/, const double& /*T0*/, const double& /*p*/, double* /*dTdp*/ = 0)
151 {
152 Errors::errorMessage("computeTemperatureIsentrope not available for requested mixture");
153 return 0.;
154 };
155
162 virtual double
163 computeEnthalpyIsentrope(const std::vector<double>& /*Yk*/, const double& /*p0*/, const double& /*T0*/, const double& /*p*/, double* /*dhdp*/ = 0)
164 {
165 Errors::errorMessage("computeEnthalpyIsentrope not available for requested mixture");
166 return 0.;
167 };
168
175 virtual double
176 computeVolumeIsentrope(const std::vector<double>& /*Yk*/, const double& /*p0*/, const double& /*T0*/, const double& /*p*/, double* /*dvdp*/ = 0)
177 {
178 Errors::errorMessage("computeVolumeIsentrope not available for requested mixture");
179 return 0.;
180 };
181
184 virtual void computeMixtureVariables(Phase** /*vecPhase*/)
185 {
186 Errors::errorMessage("computeMixtureVariables not available for requested mixture");
187 };
188
190 virtual void computeTotalEnergy(std::vector<QuantitiesAddPhys*>& /*vecGPA*/)
191 {
192 Errors::errorMessage("internalEnergyToTotalEnergy not available for requested mixture");
193 };
194
196 virtual void totalEnergyToInternalEnergy(std::vector<QuantitiesAddPhys*>& /*vecGPA*/)
197 {
198 Errors::errorMessage("totalEnergyToInternalEnergy not available for requested mixture");
199 };
200
205 virtual void localProjection(const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/)
206 {
207 Errors::errorMessage("localProjection not available for requested mixture");
208 };
209
213 virtual void reverseProjection(const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/)
214 {
215 Errors::errorMessage("reverseProjection not available for requested mixture");
216 };
217
218 //Specific methods for data printing
219 //----------------------------------
220 virtual int getNumberScalars() const
221 {
222 Errors::errorMessage("getNumberScalars not available for requested mixture");
223 return 0;
224 };
225 virtual int getNumberVectors() const
226 {
227 Errors::errorMessage("getNumberVectors not available for requested mixture");
228 return 0;
229 };
230 virtual double returnScalar(const int& /*numVar*/) const
231 {
232 Errors::errorMessage("returnScalar not available for requested mixture");
233 return 0.;
234 };
235 virtual Coord returnVector(const int& /*numVar*/) const
236 {
237 Errors::errorMessage("returnVector not available for requested mixture");
238 return 0;
239 };
240 virtual std::string returnNameScalar(const int& /*numVar*/) const
241 {
242 Errors::errorMessage("returnNameScalar not available for requested mixture");
243 return std::string("");
244 };
245 virtual std::string returnNameVector(const int& /*numVar*/) const
246 {
247 Errors::errorMessage("returnNameVector not available for requested mixture");
248 return std::string("");
249 };
250
251 //Specific method for reading from file
252 //-------------------------------------
253 virtual void setScalar(const int& /*numVar*/, const double& /*value*/)
254 {
255 Errors::errorMessage("setScalar not available for requested mixture type");
256 };
257 virtual void setVector(const int& /*numVar*/, const Coord& /*value*/)
258 {
259 Errors::errorMessage("setVector not available for requested mixture type");
260 };
261
262 //Specific methods for parallel computing
263 //---------------------------------------
265 {
266 Errors::errorMessage("numberOfTransmittedVariables not available for requested mixture type");
267 return 0;
268 };
269 virtual void fillBuffer(double* /*buffer*/, int& /*counter*/) const
270 {
271 Errors::errorMessage("fillBuffer not available for requested mixture type");
272 };
273 virtual void fillBuffer(std::vector<double>& /*dataToSend*/) const
274 {
275 Errors::errorMessage("fillBuffer not available for requested mixture type");
276 };
277 virtual void getBuffer(double* /*buffer*/, int& /*counter*/) { Errors::errorMessage("getBuffer not available for requested mixture type"); };
278 virtual void getBuffer(std::vector<double>& /*dataToReceive*/, int& /*counter*/)
279 {
280 Errors::errorMessage("getBuffer not available for requested mixture type");
281 };
282
283 //Specific methods for second order
284 //---------------------------------
285 virtual void computeSlopesMixture(const Mixture& /*sLeft*/, const Mixture& /*sRight*/, const double& /*distance*/)
286 {
287 Errors::errorMessage("computeSlopesMixture non implemente pour mixture utilise");
288 };
289 virtual void setToZero() { Errors::errorMessage("setToZero not available for requested mixture type"); };
290 virtual void setToMax() { Errors::errorMessage("setToMax not available for requested mixture type"); };
291 virtual void extrapolate(const Mixture& /*slope*/, const double& /*distance*/)
292 {
293 Errors::errorMessage("extrapolate non implemente pour mixture utilise");
294 };
295 virtual void limitSlopes(const Mixture& /*slopeGauche*/, const Mixture& /*slopeDroite*/, Limiter& /*globalLimiter*/)
296 {
297 Errors::errorMessage("limitSlopes non implemente pour mixture utilise");
298 };
299 virtual void setMin(const Mixture& /*mixture1*/, const Mixture& /*mixture2*/)
300 {
301 Errors::errorMessage("setMin not available for requested mixture type");
302 };
303 virtual void setMax(const Mixture& /*mixture1*/, const Mixture& /*mixture2*/)
304 {
305 Errors::errorMessage("setMax not available for requested mixture type");
306 };
307 virtual void computeGradientLimiter(const Limiter& /*globalLimiter*/,
308 const Mixture& /*mixture*/,
309 const Mixture& /*mixtureMin*/,
310 const Mixture& /*mixtureMax*/,
311 const Mixture& /*slope*/)
312 {
313 Errors::errorMessage("computeGradientLimiter not available for requested mixture type");
314 };
315
316 //Specific methods for parallele computing at second order
317 //--------------------------------------------------------
318 virtual int numberOfTransmittedSlopes() const
319 {
320 Errors::errorMessage("numberOfTransmittedSlopes not available for requested mixture");
321 return 0;
322 };
323 virtual void fillBufferSlopes(double* /*buffer*/, int& /*counter*/) const
324 {
325 Errors::errorMessage("fillBufferSlopes not available for requested mixture");
326 };
327 virtual void getBufferSlopes(double* /*buffer*/, int& /*counter*/)
328 {
329 Errors::errorMessage("getBufferSlopes not available for requested mixture");
330 };
331
332 //Accessors
333 //---------
334 virtual const double& getDensity() const
335 {
336 Errors::errorMessage("getDensity not available for requested mixture");
338 };
339 virtual const double& getPressure() const
340 {
341 Errors::errorMessage("getPressure not available for requested mixture");
343 };
344 virtual const double& getTemperature() const
345 {
346 Errors::errorMessage("getTemperature not available for requested mixture");
348 };
349 virtual const double& getU() const
350 {
351 Errors::errorMessage("getU not available for requested mixture");
353 };
354 virtual const double& getV() const
355 {
356 Errors::errorMessage("getV not available for requested mixture");
358 };
359 virtual const double& getW() const
360 {
361 Errors::errorMessage("getW not available for requested mixture");
363 };
364 virtual const Coord& getVelocity() const
365 {
366 Errors::errorMessage("getVelocity not available for requested mixture");
367 return Coord::defaultCoord;
368 };
370 {
371 Errors::errorMessage("getVelocity not available for requested mixture");
373 };
374 virtual const double& getEnergy() const
375 {
376 Errors::errorMessage("getEnergy not available for requested mixture");
378 };
379 virtual const double& getTotalEnergy() const
380 {
381 Errors::errorMessage("getTotalEnergy not available for requested mixture");
383 };
384 virtual const double& getFrozenSoundSpeed() const
385 {
386 Errors::errorMessage("getFrozenSoundSpeed not available for requested mixture");
388 };
389 virtual const double& getWoodSoundSpeed() const
390 {
391 Errors::errorMessage("getWoodSoundSpeed not available for requested mixture");
393 };
394 virtual const double& getMixSoundSpeed() const
395 {
396 Errors::errorMessage("getMixSoundSpeed not available for requested mixture");
398 };
399 virtual const double& getEnergyCompaction() const
400 {
401 Errors::errorMessage("getEnergyCompaction not available for requested mixture");
403 };
404 virtual const double& getEnergyElastic() const
405 {
406 Errors::errorMessage("getEnergyElastic not available for requested mixture");
408 };
409 virtual const Tensor& getStressTensor() const
410 {
411 Errors::errorMessage("getStressTensor not available for requested mixture");
413 };
415 {
416 Errors::errorMessage("getStressTensor not available for requested mixture");
418 };
419
420 virtual void setPressure(const double& /*p*/) { Errors::errorMessage("setPressure not available for requested mixture"); };
421 virtual void setTemperature(const double& /*T*/) { Errors::errorMessage("setTemperature not available for requested mixture"); }
422 virtual void setVelocity(const double& /*u*/, const double& /*v*/, const double& /*w*/)
423 {
424 Errors::errorMessage("setVelocity not available for requested mixture");
425 };
426 virtual void setVelocity(const Coord& /*vit*/) { Errors::errorMessage("setVelocity not available for requested mixture"); };
427 virtual void setU(const double& /*u*/) { Errors::errorMessage("setU not available for requested mixture"); };
428 virtual void setV(const double& /*v*/) { Errors::errorMessage("setV not available for requested mixture"); };
429 virtual void setW(const double& /*w*/) { Errors::errorMessage("setW not available for requested mixture"); };
430 virtual void setTotalEnergy(double& /*totalEnergy*/) { Errors::errorMessage("setTotalEnergy not available for requested mixture"); };
431 virtual void setEnergyCompaction(const double& /*energyCompaction*/)
432 {
433 Errors::errorMessage("setEnergyCompaction not available for requested mixture");
434 };
435 virtual void setEnergyElastic(const double& /*energyElastic*/) { Errors::errorMessage("setEnergyElastic not available for requested mixture"); };
436 virtual void setStressTensor(const Tensor& /*stressTensor*/) { Errors::errorMessage("setStressTensor not available for requested mixture"); };
437
438 //Operators
439 //---------
440 virtual void changeSign() { Errors::errorMessage("changeSign not available for requested mixture"); };
441 virtual void multiplyAndAdd(const Mixture& /*slopesMixtureTemp*/, const double& /*coeff*/)
442 {
443 Errors::errorMessage("multiplyAndAdd not available for requested mixture");
444 };
445 virtual void divide(const double& /*coeff*/) { Errors::errorMessage("divide not available for requested mixture"); };
446
447 protected:
448 private:
449};
450
451extern int numberScalarsMixture;
452
453#endif // MIXTURE_H
int numberScalarsMixture
Definition Mixture.cpp:33
@ pressure
Definition Tools.h:165
Class for a coordinate system object such as coordinates of the vertex or a vector.
Definition Coord.h:43
static Coord defaultCoordNonConst
Default Coord object (non-const version).
Definition Coord.h:58
static const Coord defaultCoord
Default Coord object (const version).
Definition Coord.h:55
General class for Equation of State (EOS).
Definition Eos.h:62
static void errorMessage(const std::string &message_)
Definition Errors.cpp:56
static constexpr double defaultDouble
Definition Errors.h:99
Definition Limiter.h:38
Abstract class for mixture variables.
Definition Mixture.h:43
virtual void computeGradientLimiter(const Limiter &, const Mixture &, const Mixture &, const Mixture &, const Mixture &)
Definition Mixture.h:307
void printMixture(std::ofstream &fileStream) const
Print mixture variables in file stream.
Definition Mixture.cpp:45
virtual const double & getTotalEnergy() const
Definition Mixture.h:379
virtual std::string returnNameVector(const int &) const
Definition Mixture.h:245
virtual double computeTemperatureIsentrope(const std::vector< double > &, const double &, const double &, const double &, double *=0)
Compute temperature for a mixture evolving at thermal equilibrium along mixture isentropic path.
Definition Mixture.h:149
virtual const double & getDensity() const
Definition Mixture.h:334
virtual double computeDensity(const double *, const double *)
Compute mixture density.
Definition Mixture.h:84
virtual void extrapolate(const Mixture &, const double &)
Definition Mixture.h:291
virtual std::string returnNameScalar(const int &) const
Definition Mixture.h:240
virtual void setTemperature(const double &)
Definition Mixture.h:421
virtual void getBuffer(double *, int &)
Definition Mixture.h:277
virtual const double & getW() const
Definition Mixture.h:359
virtual void fillBufferSlopes(double *, int &) const
Definition Mixture.h:323
virtual const double & getMixSoundSpeed() const
Definition Mixture.h:394
virtual int numberOfTransmittedSlopes() const
Definition Mixture.h:318
Mixture()
Definition Mixture.cpp:37
virtual double computePressure(double, const double &, Phase **, Mixture *, const int &, const int &)
Definition Mixture.h:103
virtual void setV(const double &)
Definition Mixture.h:428
virtual double computeFrozenSoundSpeed(const double *, const double *)
Compute mixture frozen speed of sound.
Definition Mixture.h:136
virtual void limitSlopes(const Mixture &, const Mixture &, Limiter &)
Definition Mixture.h:295
virtual int getNumberScalars() const
Definition Mixture.h:220
virtual double computeTemperature(double *, const double &, Phase **)
Definition Mixture.h:118
virtual void setEnergyCompaction(const double &)
Definition Mixture.h:431
virtual Coord & getVelocity()
Definition Mixture.h:369
virtual void setW(const double &)
Definition Mixture.h:429
virtual void setPressure(const double &)
Definition Mixture.h:420
double computePsat(const Eos *eosLiq, const Eos *eosVap, const double &temp)
Compute saturation pressure for a liq/vapor couple of fluid at given pressure.
Definition Mixture.cpp:109
virtual const double & getFrozenSoundSpeed() const
Definition Mixture.h:384
virtual double computeEnthalpyIsentrope(const std::vector< double > &, const double &, const double &, const double &, double *=0)
Compute mixture enthalpy for a mixture evolving at thermal equilibrium along mixture isentropic path.
Definition Mixture.h:163
virtual const double & getPressure() const
Definition Mixture.h:339
virtual void copyMixture(Mixture &)
Copy mixture in mixture attributes.
Definition Mixture.h:79
virtual void setU(const double &)
Definition Mixture.h:427
virtual void changeSign()
Definition Mixture.h:440
virtual void setMax(const Mixture &, const Mixture &)
Definition Mixture.h:303
virtual void setVelocity(const double &, const double &, const double &)
Definition Mixture.h:422
virtual const Tensor & getStressTensor() const
Definition Mixture.h:409
virtual void setVector(const int &, const Coord &)
Definition Mixture.h:257
virtual void computeTotalEnergy(std::vector< QuantitiesAddPhys * > &)
Compute mixture total specific energy from internal one taking account for energies associated to ext...
Definition Mixture.h:190
double computeTsat(const Eos *eosLiq, const Eos *eosVap, const double &pressure, double *dTsat=0)
Compute saturation temperature for a liq/vapor couple of fluid at given pressure.
Definition Mixture.cpp:59
virtual void computeMixtureVariables(Phase **)
Fills some mixture attributes from a phase array.
Definition Mixture.h:184
virtual const double & getEnergyElastic() const
Definition Mixture.h:404
virtual double computeVelocity(const double *, const double *)
Compute mixture velocity.
Definition Mixture.h:113
virtual void allocateAndCopyMixture(Mixture **)
Copy mixture attributes in mixture.
Definition Mixture.h:73
virtual void reverseProjection(const Coord &, const Coord &, const Coord &)
velocity vector reverse projection in the absolute Cartesian coordinate system
Definition Mixture.h:213
virtual void setToMax()
Definition Mixture.h:290
virtual void setVelocity(const Coord &)
Definition Mixture.h:426
virtual const double & getWoodSoundSpeed() const
Definition Mixture.h:389
virtual void setMin(const Mixture &, const Mixture &)
Definition Mixture.h:299
virtual void getBuffer(std::vector< double > &, int &)
Definition Mixture.h:278
double computeCriticalPressure(const Eos *eosLiq, const Eos *eosVap)
Compute the theoritical critical pressure.
Definition Mixture.cpp:156
virtual const double & getTemperature() const
Definition Mixture.h:344
virtual double computeInternalEnergy(const double *, const double *)
Compute mixture specific internal energy.
Definition Mixture.h:127
virtual void multiplyAndAdd(const Mixture &, const double &)
Definition Mixture.h:441
virtual void fillBuffer(double *, int &) const
Definition Mixture.h:269
virtual void setEnergyElastic(const double &)
Definition Mixture.h:435
virtual const double & getEnergy() const
Definition Mixture.h:374
virtual const double & getEnergyCompaction() const
Definition Mixture.h:399
virtual const double & getU() const
Definition Mixture.h:349
virtual void fillBuffer(std::vector< double > &) const
Definition Mixture.h:273
virtual Tensor & getStressTensor()
Definition Mixture.h:414
virtual ~Mixture()
Definition Mixture.cpp:41
virtual void setScalar(const int &, const double &)
Definition Mixture.h:253
virtual const Coord & getVelocity() const
Definition Mixture.h:364
virtual Coord returnVector(const int &) const
Definition Mixture.h:235
virtual int getNumberVectors() const
Definition Mixture.h:225
virtual void setTotalEnergy(double &)
Definition Mixture.h:430
virtual void getBufferSlopes(double *, int &)
Definition Mixture.h:327
virtual void localProjection(const Coord &, const Coord &, const Coord &)
velocity vector projection in a local Cartesian coordinate system
Definition Mixture.h:205
virtual double computeVolumeIsentrope(const std::vector< double > &, const double &, const double &, const double &, double *=0)
Compute mixture specific volume for a mixture evolving at thermal equilibrium along mixture isentropi...
Definition Mixture.h:176
virtual void setToZero()
Definition Mixture.h:289
virtual double returnScalar(const int &) const
Definition Mixture.h:230
virtual void computeSlopesMixture(const Mixture &, const Mixture &, const double &)
Definition Mixture.h:285
virtual int numberOfTransmittedVariables() const
Definition Mixture.h:264
virtual double computePressure(double *, const double &, Phase **)
Definition Mixture.h:98
virtual void setStressTensor(const Tensor &)
Definition Mixture.h:436
virtual void divide(const double &)
Definition Mixture.h:445
virtual const double & getV() const
Definition Mixture.h:354
virtual double computePressure(const double *, const double *)
Compute mixture pressure.
Definition Mixture.h:93
virtual void totalEnergyToInternalEnergy(std::vector< QuantitiesAddPhys * > &)
Compute mixture internal specific energy from total one taking account for energies associated to ext...
Definition Mixture.h:196
Abstract class for a phase.
Definition Phase.h:47
Class for a matrix 3x3 system object.
Definition Tensor.h:57
static const Tensor defaultTensor
Default Tensor object (const version).
Definition Tensor.h:75
static Tensor defaultTensorNonConst
Default Tensor object (non-const version).
Definition Tensor.h:78