Commit f51907bf authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

[components] Replace std::pow were possible

parent e6c77b9b
......@@ -143,7 +143,8 @@ public:
1.16145*std::pow(Tstar, -0.14874) +
0.52487*std::exp(- 0.77320*Tstar) +
2.16178*std::exp(- 2.43787*Tstar);
Scalar mu = 40.785*Fc*std::sqrt(M*temperature)/(std::pow(Vc, 2./3)*Omega_v);
Scalar mu = 40.785 * Fc * std::sqrt(M * temperature)
/ (std::cbrt(Vc * Vc) * Omega_v);
// convertion from micro poise to Pa s
return mu/1e6 / 10;
......@@ -152,14 +153,12 @@ public:
// simpler method, from old constrelAir.hh
static Scalar simpleGasViscosity(Scalar temperature, Scalar pressure)
{
Scalar r;
if(temperature < 273.15 || temperature > 660.)
{
DUNE_THROW(NumericalProblem,
"simpleGasViscosity: Temperature out of range! (T = " << temperature << " K)");
}
r = 1.496*1.E-6*std::pow(temperature,1.5)/(temperature+120.);
return (r);
return 1.496e-6 * std::cbrt(temperature * temperature) / (temperature + 120.);
}
......
......@@ -867,7 +867,7 @@ private:
static constexpr Scalar heatCap_p_Region1_(Scalar temperature, Scalar pressure)
{
return
- pow(Region1::tau(temperature), 2 ) *
-1 * Region1::tau(temperature) * Region1::tau(temperature) *
Region1::ddGamma_ddTau(temperature, pressure) *
Rs;
}
......@@ -877,10 +877,10 @@ private:
{
Scalar tau = Region1::tau(temperature);
Scalar num = Region1::dGamma_dPi(temperature, pressure) - tau * Region1::ddGamma_dTaudPi(temperature, pressure);
Scalar diff = pow(num, 2) / Region1::ddGamma_ddPi(temperature, pressure);
Scalar diff = num * num / Region1::ddGamma_ddPi(temperature, pressure);
return
- pow(tau, 2 ) *
-1 * tau * tau *
Region1::ddGamma_ddTau(temperature, pressure) * Rs +
diff;
}
......@@ -925,7 +925,7 @@ private:
static constexpr Scalar heatCap_p_Region2_(Scalar temperature, Scalar pressure)
{
return
- pow(Region2::tau(temperature), 2 ) *
-1 * Region2::tau(temperature) * Region2::tau(temperature) *
Region2::ddGamma_ddTau(temperature, pressure) *
Rs;
}
......@@ -938,7 +938,7 @@ private:
Scalar num = 1 + pi * Region2::dGamma_dPi(temperature, pressure) + tau * pi * Region2::ddGamma_dTaudPi(temperature, pressure);
Scalar diff = num * num / (1 - pi * pi * Region2::ddGamma_ddPi(temperature, pressure));
return
- pow(tau, 2 ) *
-1 * tau * tau *
Region2::ddGamma_ddTau(temperature, pressure) * Rs
- diff;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment