Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
lambda2alpha.h

The combustion problem – inversion of the parameter function.

The combustion problem – inversion of the parameter function

#include "lambda_c.h"
Float lambda2alpha (Float lambda, bool up = false) {
static const Float ac = alpha_c();
Float tol = 1e2*numeric_limits<Float>::epsilon();
size_t max_iter = 1000;
Float a_min = up ? ac : 0;
Float a_max = up ? 100 : ac;
for (size_t k = 0; abs(a_max - a_min) > tol; ++k) {
Float a1 = (a_max + a_min)/2;
Float lambda1 = 8*sqr(a1/cosh(a1));
if ((up && lambda > lambda1) || (!up && lambda < lambda1))
{ a_max = a1; }
else { a_min = a1; }
check_macro (k < max_iter, "lambda2alpha: max_iter=" << k
<< " reached and err=" << a_max - a_min);
}
return(a_max + a_min)/2;
};
see the Float page for the full documentation
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
Float lambda2alpha(Float lambda, bool up=false)
The combustion problem – the critical parameter value as a function.
Float alpha_c()
Definition lambda_c.h:36