how to calculate the magnitude (module) of a gradient
Goodmorning, I'm working in the frame of phase field models for solidification.
I've to solve a transport equation for the phase field (-1 in one phase,1 in the other one and a smooth passage atthe interface).
The equation i've to solve present the module of the gradient |grad f| (the vector magnitude):
df/dt+V*grad f=a*[ laplacian f+f*(1-f)/b-|grad f| div [ grad f/|grad f|]]
with a,b parameters (or constants).
how can I calculate the |grad f| term when I want to solve the equation?
I tried that way:
1) |grad f| ==== mag(fvc::grad(phase))
where phase is my "f"
2)otherwise I also tried to first define:
volVectorField gradphase = fvc::grad(phase);
|grad f| ==== mag(gradphase)
are they equivalent? or at least, is one correct?
Thank you in advance, I'm quite new in openfoam (and in c++).
I think they are equivalent but what is "===="?
|All times are GMT -4. The time now is 10:05.|