CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

how to calculate the magnitude (module) of a gradient

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 27, 2011, 09:32
Default how to calculate the magnitude (module) of a gradient
  #1
Member
 
valerio
Join Date: Jun 2009
Location: Nancy
Posts: 30
Rep Power: 8
Alucard is on a distinguished road
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++).
Alucard is offline   Reply With Quote

Old   October 28, 2011, 03:33
Default
  #2
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 322
Rep Power: 8
ata is on a distinguished road
Hi
I think they are equivalent but what is "===="?
ata is offline   Reply With Quote

Old   October 28, 2011, 04:43
Default
  #3
Member
 
valerio
Join Date: Jun 2009
Location: Nancy
Posts: 30
Rep Power: 8
Alucard is on a distinguished road
Quote:
Originally Posted by ata View Post
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 -->.
Alucard is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF-How to calculate gradient of a scalar Tony Tonton Fluent UDF and Scheme Programming 16 February 9, 2015 02:12
How to calculate the gradient along the boundaries from a known volScalarFiled? shddx1 OpenFOAM Programming & Development 2 October 28, 2011 18:04
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 16:44
how to calculate the gradient of volume fraction hxhua FLUENT 0 July 1, 2005 08:43


All times are GMT -4. The time now is 21:49.