|
[Sponsors] |
how to calculate the magnitude (module) of a gradient |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 27, 2011, 10:32 |
how to calculate the magnitude (module) of a gradient
|
#1 |
Member
valerio
Join Date: Jun 2009
Location: Nancy
Posts: 30
Rep Power: 17 |
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); and after |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++). |
|
October 28, 2011, 04:33 |
|
#2 |
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18 |
Hi
I think they are equivalent but what is "===="? |
|
October 28, 2011, 05:43 |
|
#3 |
Member
valerio
Join Date: Jun 2009
Location: Nancy
Posts: 30
Rep Power: 17 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF-How to calculate gradient of a scalar | Tony Tonton | Fluent UDF and Scheme Programming | 19 | November 20, 2023 09:13 |
How to calculate the gradient along the boundaries from a known volScalarFiled? | shddx1 | OpenFOAM Programming & Development | 7 | March 16, 2017 11:47 |
Can someone PLEASE document the development version installation | bernd | OpenFOAM Installation | 76 | November 14, 2008 22:51 |
Calculate normal gradient | Sunil | FLUENT | 0 | April 30, 2008 17:44 |
how to calculate the gradient of volume fraction | hxhua | FLUENT | 0 | July 1, 2005 09:43 |