27 #ifndef ANTIOCH_MIXTURE_DIFFUSION_H
28 #define ANTIOCH_MIXTURE_DIFFUSION_H
54 template<
typename Diffusion,
class CoeffType>
67 template<
typename StateType,
typename MatrixStateType>
69 const StateType& molar_density,
70 MatrixStateType&
D )
const;
73 template<
typename StateType>
75 const StateType&
cp,
const StateType& k,
94 template <
typename StateType>
123 "This shouldn't happen!" );
133 "This shouldn't happen!" );
146 _binary_diffusivities[i][j] =
new Diffusion( s_i, s_j );
153 template<
typename StateType,
typename MatrixStateType>
155 const StateType& molar_density,
159 for(
unsigned int i = 0; i < D.size(); i++)
161 for(
unsigned int j = 0; j < D.size(); j++)
165 D[i][j] = (*_binary_diffusivities[i][j])(T,molar_density);
171 template<
typename StateType,
typename MatrixStateType>
182 template<
typename StateType>
184 const StateType& rho,
190 D = (*_species_diffusivities[s]).
D(rho,cp,k);
194 template<
typename StateType>
209 template<
typename Diffusion,
class CoeffType>
220 "Can only instantiate MixtureDiffusion with a species or binary diffusion model!" );
222 std::string error =
"ERROR: You're trying to construct an object\n";
223 error +=
" with an unknown diffusion model!\n";
224 error +=
" Does your compiler not support static_assert?";
234 template<
typename Diffusion,
class CoeffType>
241 it != _species_diffusivities.end(); ++it )
249 it_outer != _binary_diffusivities.end(); ++it_outer )
251 it_inner != it_outer->end(); ++it_inner )
256 template<
typename Diffusion,
class CoeffType>
257 template<
typename StateType,
typename MatrixStateType>
260 const StateType& molar_density,
261 MatrixStateType&
D )
const
263 const unsigned int n_cols = D.size();
268 for(
unsigned int r = 0; r < n_cols; r++ )
274 this->private_diff_matrix_impl(T,molar_density,D,tag);
277 template<
typename Diffusion,
class CoeffType>
278 template<
typename StateType>
281 const StateType& rho,
291 this->private_species_diff_impl(s,rho,cp,k,D,tag);
294 template<
typename Diffusion,
class CoeffType>
295 template<
typename StateType>
300 "Invalid to extrapolate temperature with a non-binary diffusion model!" );
303 it_outer != _binary_diffusivities.end(); ++it_outer )
306 it_inner != it_outer->end(); ++it_inner )
308 (*it_inner)->extrapolate_max_temp(Tmax);
313 template<
typename Diffusion,
class CoeffType>
315 const std::vector<CoeffType>& coeffs )
318 "Invalid to add species diffusion model with Diffusion model is not a species diffusion model!" );
321 _species_diffusivities[s] =
new Diffusion( coeffs );
326 #endif // ANTIOCH_MIXTURE_DIFFUSION_H
void add_species_diffusion(unsigned int s, const std::vector< CoeffType > &coeffs)
Add species diffusion model for species s.
#define antioch_assert(asserted)
void private_species_diff_impl(unsigned int s, const StateType &rho, const StateType &cp, const StateType &k, StateType &D, AntiochPrivate::diffusion_tag< SpeciesDiffusionBase< Diffusion, CoeffType > > &) const
Compute species diffusivities.
std::vector< std::vector< BinaryDiffusionBase< Diffusion, CoeffType > * > > _binary_diffusivities
Stores binary diffusion model for all species pairs.
std::vector< SpeciesDiffusionBase< Diffusion, CoeffType > * > _species_diffusivities
Stores species diffusivity models.
#define antioch_assert_equal_to(expr1, expr2)
#define antioch_assert_greater(expr1, expr2)
#define antioch_assert_less(expr1, expr2)
const TransportMixture< CoeffType > & _transport_mixture
Base class for species diffusion models.
void private_species_diff_impl(unsigned int, const StateType &, const StateType &, const StateType &, StateType &, AntiochPrivate::diffusion_tag< BinaryDiffusionBase< Diffusion, CoeffType > > &) const
Invalid to call species diffusivity calculation with BinaryDiffusionBase model.
Class to encapsulate data relevant for transport for each chemical species.
Container class for species binary diffusion models.
Scalar cp(Scalar T, Scalar a0, Scalar a1, Scalar a2, Scalar a3, Scalar a4, Scalar a5, Scalar a6)
virtual ~MixtureDiffusion()
void private_diff_matrix_impl(const StateType &, const StateType &, MatrixStateType &, AntiochPrivate::diffusion_tag< SpeciesDiffusionBase< Diffusion, CoeffType > > &) const
Invalid to call binary diffusion matrix with SpeciesDiffusionBase model.
#define antioch_error_msg(errmsg)
Base class for MixtureViscosity, MixtureConductivity, etc.
Class storing chemical mixture properties.
#define antioch_static_assert(cond, errmsg)
void compute_species_diffusivity(unsigned int s, const StateType &rho, const StateType &cp, const StateType &k, StateType &D) const
Computes species diffusivity for species s.
Base class for binary diffusion models.
void compute_binary_diffusion_matrix(const StateType &T, const StateType &molar_density, MatrixStateType &D) const
Computes the binary diffusion matrix.
Characteristics of various diffusion models.
#define antioch_static_assert_runtime_fallback(cond, errmsg)
void private_init_impl(AntiochPrivate::diffusion_tag< BinaryDiffusionBase< Diffusion, CoeffType > > &)
Initialize binary diffusion models.
void extrapolate_max_temp(const StateType &Tmax)
Extrapolate to input maximum temperature, given in [K].
void private_init_impl(AntiochPrivate::diffusion_tag< SpeciesDiffusionBase< Diffusion, CoeffType > > &)
Initialize species diffusion models.
The parameters are reduced parameters.
void private_diff_matrix_impl(const StateType &T, const StateType &molar_density, MatrixStateType &D, AntiochPrivate::diffusion_tag< BinaryDiffusionBase< Diffusion, CoeffType > > &) const
Compute binary diffusion matrix.
const TransportMixture< CoeffType > & transport_mixture() const
We use these tags to force operator overloading based on Diffusion type.