define sign scalar
Hi,
I set up a passive scalar. But when calculating, the negative values come out. Actually, the passive can not be negative. How to set the scalar to be sign type (only positive or zero value)? |
Dear zx
you can do like this rho == max(rho, rhoMin); you should insert your value in rhoMin position. |
Quote:
|
1 Attachment(s)
Hello zx and niaz!!
I'm facing the same problem. I'm simulating the transport of a passive scalar (C) in a biphasic flow by interDymFoam and the values are negatives. I created a new solver based on interDyFoam (interDyMScalarFoam.C) as can seen on the attached files. The solver works fine, however the values of the passive scalar are negatives. I tried to use other numerical schemes such as suggested by Jasak on post #13, but without success. You could give me more details of how you solved this problem. Where do you set rho == max(rho, rhoMin);? Link to download the files (interDyMScalarFoam.C, C, fvSchemes, fvSolutions) https://dl.dropboxusercontent.com/u/...onForum.tar.gz Thanks a lot. |
You may try C==max(C,0.0) after you solve the scalar transport equation.
Thanks, Jian |
All times are GMT -4. The time now is 22:00. |