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.

minimum between two variables

Please login with a confirmed email address before reporting spam

Hi, I'm performing a simulation using the Heat Transfer in Fluids and Laminar Fluid Flow modules. In my problem, the viscosity is governed by two different equations. I need to impose that the dynamic viscosity (n) to be used (imposed as user defined in the Laminar Flow under Fluid Properties) is the minimum value between the two viscosities calculated according to the two different equations, something like:

n=min(nT,nY)

I wonder if this is the correct way to ask Comsol to calculate the minimum between two variables or not.

Thank you, all the best, Valentina


5 Replies Last Post Jan 8, 2018, 2:37 p.m. EST
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Dec 21, 2017, 11:05 a.m. EST

Good guess! See Reference Manual for COMSOL Multiphysics, version 5.3a, page 244. All documentation is accessible through File > Help > Documentation.

Jeff

-------------------
Jeff Hiller
Good guess! See Reference Manual for COMSOL Multiphysics, version 5.3a, page 244. All documentation is accessible through File > Help > Documentation. Jeff

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Dec 26, 2017, 12:43 p.m. EST

Hi, I checked on the documentation for Comsol 5.3, but I don't understand if the expression MIN can be used in my case, since the arguments are variables. I read that there is also ATTIMEMIN, but I think is not useful for my case, since I need to define the viscosity imposed as user defined in the Laminar Flow under Fluid Properties as the minimum between the two variables. It's not a result evaluation. I tried to run the code using n=min(nT,nY), but the simulation gives error after a while during the calculations.

Thanks, Valentina

Hi, I checked on the documentation for Comsol 5.3, but I don't understand if the expression MIN can be used in my case, since the arguments are variables. I read that there is also ATTIMEMIN, but I think is not useful for my case, since I need to define the viscosity imposed as user defined in the Laminar Flow under Fluid Properties as the minimum between the two variables. It's not a result evaluation. I tried to run the code using n=min(nT,nY), but the simulation gives error after a while during the calculations. Thanks, Valentina

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Jan 2, 2018, 9:17 a.m. EST

Hello Valentina,

Min should work even for variables, so I suspect the source of your problem is somewhere else. I recommend you contact COMSOL's support team at support@comsol.com .

Best,

Jeff

-------------------
Jeff Hiller
Hello Valentina, Min should work even for variables, so I suspect the source of your problem is somewhere else. I recommend you contact COMSOL's support team at support@comsol.com . Best, Jeff

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Jan 7, 2018, 5:58 a.m. EST

Thank you so much, all the best, Vale

Thank you so much, all the best, Vale

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Jan 8, 2018, 2:37 p.m. EST
Updated: 7 years ago Jan 8, 2018, 2:39 p.m. EST

Hi, I got this error when I try to run the model:

Velocity u, Pressure p Attempt to evaluate negative power of zero. - Function: ^ Failed to evaluate temporary symbolic derivative variable. - Variable: epII@VDN$mod.ux - Defined as: (0.5((0.5((((2(((ep12^2)+(ep13^2))+(ep23^2)))+(ep11^2))+(ep22^2))+(ep33^2)))^(-0.5)))(0.5(2ep11)) Failed to evaluate temporary symbolic derivative variable. - Variable: nb@VDN$mod.ux - Defined as: (((0.5((0.5((((2(((ep12^2)+(ep13^2))+(ep23^2)))+(ep11^2))+(ep22^2))+(ep33^2)))^(-0.5)))(0.5(2ep11)))1.4142135623730951)((-(c0-(((fcrho)g)z)))/((epII1.4142135623730951)^2)) Failed to evaluate temporary symbolic derivative variable. - Variable: n@VDN$mod.ux - Defined as: (nT>nb)((((0.5((0.5((((2(((ep12^2)+(ep13^2))+(ep23^2)))+(ep11^2))+(ep22^2))+(ep33^2)))^(-0.5)))(0.5(2ep11)))1.4142135623730951)((-(c0-(((fcrho)g)z)))/((epII1.4142135623730951)^2))) Failed to evaluate temporary symbolic derivative variable. - Variable: mod.spf.mu@VDN$mod.ux - Defined as: (nT>nb)((((0.5((0.5((((2(((ep12^2)+(ep13^2))+(ep23^2)))+(ep11^2))+(ep22^2))+(ep33^2)))^(-0.5)))(0.5(2ep11)))1.4142135623730951)((-(c0-(((fcrho)g)z)))/((epII1.4142135623730951)^2))) Failed to evaluate temporary symbolic derivative variable. - Variable: mod.spf.mu_eff@VDN$mod.ux - Defined as: (nT>nb)((((0.5((0.5((((2(((ep12^2)+(ep13^2))+(ep23^2)))+(ep11^2))+(ep22^2))+(ep33^2)))^(-0.5)))(0.5(2ep11)))1.4142135623730951)((-(c0-(((fcrho)g)z)))/((epII1.4142135623730951)^2))) Failed to evaluate temporary symbolic derivative variable. - Variable: mod.spf.K_stress_tensorxz@VDN$mod.ux - Defined as: (mod.uz+mod.wx)((nT>nb)((((0.5((0.5((((2(((ep12^2)+(ep13^2))+(ep23^2)))+(ep11^2))+(ep22^2))+(ep33^2)))^(-0.5)))(0.5(2ep11)))1.4142135623730951)((-(c0-(((fcrho)g)z)))/((epII1.4142135623730951)^2)))) Failed to evaluate expression. - Expression: dvol(-((mod.uz+mod.wx)((nT>nb)((((0.5((0.5((((2(((ep12^2)+(ep13^2))+(ep23^2)))+(ep11^2))+(ep22^2))+(ep33^2)))^(-0.5)))(0.5(2ep11)))1.4142135623730951)((-(c0-(((fcrho)g)z)))/((epII1.4142135623730951)^2)))))) Failed to evaluate Jacobian of expression. - Expression: dvol(-mod.spf.K_stress_tensorxz) Failed to evaluate Jacobian of expression. - Expression: ((mod.p-mod.spf.K_stress_tensorxx)test(mod.ux)-mod.spf.K_stress_tensorxytest(mod.uy)-mod.spf.K_stress_tensorxztest(mod.uz)-mod.spf.K_stress_tensoryxtest(mod.vx)+(mod.p-mod.spf.K_stress_tensoryy)test(mod.vy)-mod.spf.K_stress_tensoryztest(mod.vz)-mod.spf.K_stress_tensorzxtest(mod.wx)-mod.spf.K_stress_tensorzytest(mod.wy)+(mod.p-mod.spf.K_stress_tensorzz)test(mod.wz))*(dvol)

what can be the issue?

thank you, all the best, V.

Hi, I got this error when I try to run the model: Velocity u, Pressure p Attempt to evaluate negative power of zero. - Function: ^ Failed to evaluate temporary symbolic derivative variable. - Variable: epII@VDN$mod.ux - Defined as: (0.5*((0.5*((((2*(((ep12^2)+(ep13^2))+(ep23^2)))+(ep11^2))+(ep22^2))+(ep33^2)))^(-0.5)))*(0.5*(2*ep11)) Failed to evaluate temporary symbolic derivative variable. - Variable: nb@VDN$mod.ux - Defined as: (((0.5*((0.5*((((2*(((ep12^2)+(ep13^2))+(ep23^2)))+(ep11^2))+(ep22^2))+(ep33^2)))^(-0.5)))*(0.5*(2*ep11)))*1.4142135623730951)*((-(c0-(((fc*rho)*g)*z)))/((epII*1.4142135623730951)^2)) Failed to evaluate temporary symbolic derivative variable. - Variable: n@VDN$mod.ux - Defined as: (nT>nb)*((((0.5*((0.5*((((2*(((ep12^2)+(ep13^2))+(ep23^2)))+(ep11^2))+(ep22^2))+(ep33^2)))^(-0.5)))*(0.5*(2*ep11)))*1.4142135623730951)*((-(c0-(((fc*rho)*g)*z)))/((epII*1.4142135623730951)^2))) Failed to evaluate temporary symbolic derivative variable. - Variable: mod.spf.mu@VDN$mod.ux - Defined as: (nT>nb)*((((0.5*((0.5*((((2*(((ep12^2)+(ep13^2))+(ep23^2)))+(ep11^2))+(ep22^2))+(ep33^2)))^(-0.5)))*(0.5*(2*ep11)))*1.4142135623730951)*((-(c0-(((fc*rho)*g)*z)))/((epII*1.4142135623730951)^2))) Failed to evaluate temporary symbolic derivative variable. - Variable: mod.spf.mu_eff@VDN$mod.ux - Defined as: (nT>nb)*((((0.5*((0.5*((((2*(((ep12^2)+(ep13^2))+(ep23^2)))+(ep11^2))+(ep22^2))+(ep33^2)))^(-0.5)))*(0.5*(2*ep11)))*1.4142135623730951)*((-(c0-(((fc*rho)*g)*z)))/((epII*1.4142135623730951)^2))) Failed to evaluate temporary symbolic derivative variable. - Variable: mod.spf.K_stress_tensorxz@VDN$mod.ux - Defined as: (mod.uz+mod.wx)*((nT>nb)*((((0.5*((0.5*((((2*(((ep12^2)+(ep13^2))+(ep23^2)))+(ep11^2))+(ep22^2))+(ep33^2)))^(-0.5)))*(0.5*(2*ep11)))*1.4142135623730951)*((-(c0-(((fc*rho)*g)*z)))/((epII*1.4142135623730951)^2)))) Failed to evaluate expression. - Expression: dvol*(-((mod.uz+mod.wx)*((nT>nb)*((((0.5*((0.5*((((2*(((ep12^2)+(ep13^2))+(ep23^2)))+(ep11^2))+(ep22^2))+(ep33^2)))^(-0.5)))*(0.5*(2*ep11)))*1.4142135623730951)*((-(c0-(((fc*rho)*g)*z)))/((epII*1.4142135623730951)^2)))))) Failed to evaluate Jacobian of expression. - Expression: dvol*(-mod.spf.K_stress_tensorxz) Failed to evaluate Jacobian of expression. - Expression: ((mod.p-mod.spf.K_stress_tensorxx)*test(mod.ux)-mod.spf.K_stress_tensorxy*test(mod.uy)-mod.spf.K_stress_tensorxz*test(mod.uz)-mod.spf.K_stress_tensoryx*test(mod.vx)+(mod.p-mod.spf.K_stress_tensoryy)*test(mod.vy)-mod.spf.K_stress_tensoryz*test(mod.vz)-mod.spf.K_stress_tensorzx*test(mod.wx)-mod.spf.K_stress_tensorzy*test(mod.wy)+(mod.p-mod.spf.K_stress_tensorzz)*test(mod.wz))*(dvol) what can be the issue? thank you, all the best, V.

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.