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

how to calculate the magnitude (module) of a gradient

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 27, 2011, 10:32
Default how to calculate the magnitude (module) of a gradient
  #1
Member
 
valerio
Join Date: Jun 2009
Location: Nancy
Posts: 30
Rep Power: 17
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, 04:33
Default
  #2
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18
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, 05:43
Default
  #3
Member
 
valerio
Join Date: Jun 2009
Location: Nancy
Posts: 30
Rep Power: 17
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


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 Off
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 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


All times are GMT -4. The time now is 06:43.