Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

How to create a conditional in a definition?

Sebastian Sepulveda Cano

Please login with a confirmed email address before reporting spam

I am doing a two-phase flow analysis in Comsol, based on the model found in the Comsol application gallery called "two-phase flow in column". I have some problems because when I do the analysis I get the following error "Attempt to evaluate the power of zero". According to this i think that the error is due to one of the definitions that is used to calculate the effective saturation degree of the liquid phase.

The definitions that I have in the retention model are:

p_c p_nw-p_w Capillary pressure

Hc p_c / (rho_w * g_const) Capillary pressure head

Se_w (1+ (alpha * rm1 (Hc [1 / m]) [m]) ^ N) ^ (- M) Effective saturation, wetting phase

Se_nw 1-Se_w Effective saturation, non-wetting phase

theta_w theta_r+Se_w*(theta_s-theta_r) Volume fraction, wetting phase

theta_nw theta_s-theta_w Volume fraction, non-wetting phase

kr_w (Se_w^L*(1-(1-Se_w^(1/M))^M)^2)+eps Relative permeability, wetting phase

kr_nw ((1-Se_w)^L(1-Se_w^(1/M))^(2M))+eps Relative permeability, non-wetting phase

Cp ((alphaM/(1-M)(theta_s-theta_r)Se_w^(1/M)(1-Se_w^(1/M))^M))/(rho_w*g_const) Specific capacity

i think that the problem is in the third definition. The question is that there is the possibility of applying a conditional to the definitions in comsol to restrict the analysis to that if Hc <= 0 then Se_w = 1.

Thank you for your attention.


0 Replies Last Post Feb 14, 2018, 6:05 p.m. EST
COMSOL Moderator

Hello Sebastian Sepulveda Cano

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.