# how to calculate the magnitude (module) of a gradient

 Register Blogs Members List Search Today's Posts Mark Forums Read

 October 27, 2011, 09:32 how to calculate the magnitude (module) of a gradient #1 Member   valerio Join Date: Jun 2009 Location: Nancy Posts: 30 Rep Power: 10 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, 03:33 #2 Senior Member     ata kamyabi Join Date: Aug 2009 Location: Kerman Posts: 323 Rep Power: 11 Hi I think they are equivalent but what is "===="?

October 28, 2011, 04:43
#3
Member

valerio
Join Date: Jun 2009
Location: Nancy
Posts: 30
Rep Power: 10
Quote:
 Originally Posted by ata Hi I think they are equivalent but what is "===="?
Sorry , it is just a symbolic way to indicate how I calculate the term,look at it like an arrow if you prefere -->.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post shddx1 OpenFOAM Programming & Development 7 March 16, 2017 11:47 Tony Tonton Fluent UDF and Scheme Programming 17 September 21, 2015 09:13 bernd OpenFOAM Installation 76 November 14, 2008 22:51 Sunil FLUENT 0 April 30, 2008 16:44 hxhua FLUENT 0 July 1, 2005 08:43

All times are GMT -4. The time now is 09:20.