Unit Normal vector Component Divided by Zero
Hi,
I am running a 3D Transient simulation of Mixture model (water&air),the problem when I try to compute the unit normal vector components Nx,Ny,Nz at the interface that defined as fluid(water or gas)volume fraction gradient X,Y,Z divided by magnitude of total of fluid volume gradient.when running a case, my simulation crashes as the unit normal vector divides by 0.and if i cancel unit normals expressions from ccl and rerun solver all volume fraction gradient are ok |
You will need to put something in your function to handle when the gradient is zero in all directions. Use the if() statement, or something like it, so you do not do the divide when the gradient is zero.
|
your quick reply is appreciated thanks.really i ve to find which interrelatd function.i mean normal units needs free surface to be calculated.if i get normal units thats mean the free surface is istablished.i ll try interface length scale as conditional statement as i think it is not zero
|
Or maybe just simply make the function something like:
ComponentX = if(GradMag == 0, 0, GradX/GradMag) |
i tried problem still persist
The problem was: | DIVIDE-BY-ZERO | | FURTHER INFORMATION | | The problem was encountered in executing the expression for: | Gas Normal X | The complete expression is: | (Gas.vf.Gradient X/AIAD VF Grad Mod Gas ) | The error occurs on sub-expression: | Gas.vf.Gradient X/AIAD VF Grad Mod Gas where AIAD VF Grad Mod Gas is the magnitude |
You are dividing by zero. Why don't you use the min-function?
Gas Normal X = Gas.vf.Gradient X/min(1e-6; AIAD VF Grad Mod Gas) |
Both expressions didnt work
The problem was: | | DIVIDE-BY-ZERO | | | | FURTHER INFORMATION | | | | The problem was encountered in executing the expression for: | | Gas Normal X | | The complete expression is: | | Gas.vf.Gradient X/min(1e-6[m^-1], AIAD VF Grad Mod Gas) |
The geometry consists of two horizontal tubes (T-section) and the flow of both fluids develops properly before they are mixed together.may be at first simulation time is really there is no gradient or change in volume fraction.i am not sure
|
You have a gradient. So this might range from large negative values up to large positive values. Therefore you should create a function that prevents diving by zero coming from the negative direction and the positive direction. Currently, you are only protected for Division by zero coming from the positive direction.
|
i found the same issue but in openfoam
https://www.cfd-online.com/Forums/op...tml#post844858 but i didnt catch the solution as i dont used to use openfoam |
Your function is incorrect, try
Gas Normal X = Gas.vf.Gradient X/max(1e-6; AIAD VF Grad Mod Gas) |
Indeed. It was late in the evening........ :rolleyes:
Then still, now the equation caps all gradients with a negative sign. Therefore gyr should define an equation himself that caps very small negative and positive values. Then it might work. |
I am assuming gyr is calculating the gradient magnitude correctly - this should not ever be a negative number.
|
ohhh i ll try Max function and feedback.thanks for Gert-Jan&ghorrocks
:o |
it worked thanks again:D
|
All times are GMT -4. The time now is 15:56. |