Hello, I'm trying to solve a 2D advection-diffusion-reaction problem with a strong non-linear source term that is piecewise defined with dependence from the value of a difference of temperature:
$$ q = a\;f(x,y)^{0.566} \Delta T^{0.461}\quad \text{for }\Delta T > 300 $$
$$ q = 1.87\times 10^{-5} \Delta T^{5.55}\quad \text{for } 0 <\Delta T < 300 $$
What I tried so far is:
u = Function(Q)
# [...]
# Non-integer exponent of negative basis gives NaN
# And since the problem is non-linear during Newton iterations
# It can happen that we get a Delta T that is negative
dt = conditional(ge(u - T0), 0), u-T0, 0)
q = conditional(ge(dt), 300), f1, f2)
where f1
and f2
are the two expressions I wrote before. This does not seem to work since I'm getting NaN
... If I use just one conditional I get some results. Any suggestion on how to implement this?