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

About Level Set Method

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 15, 2014, 04:09
Default About Level Set Method
  #1
New Member
 
kevin
Join Date: Mar 2014
Posts: 2
Rep Power: 0
kevinLL is on a distinguished road
Hello,
I want to use the level set method to investigate the multiphase flow based on openFoam software, but unfortunately failed. Could someone please give me some advice? Thank you very much!
Here is what I have done:
1. Define the level set function φ as a volScalarFields in OpenFoam
2. Give the level set function φ an initial value using the funkySetFields, as it’s a distance function from the interface. Here is the formula:
φ_0=(x-a)2+〖(y-b)〗^2+(z-c)2-r
3. Start the time loop
4. Try to solve the level set function like this:
fvScalarMatrix levelsetphiEqn
(
fvm::ddt(levelsetphi) + fvm::div(phi, levelsetphi)
);
levelsetphiEqn.solve();

5. Update the transport properties:
density: ρ=ρ_f H+ρ_g (1-H)
viscosity: μ=μ_f H+μ_g (1-H)

6. Reinitialize the level set function with the following equation:
{■(φ_τ=sign(φ_0)(1-|∇φ|)@φ(x,0)=φ_0 )┤
7. Solve the conservation equantion: ∇∙u=0
ρ Du/Dt=-∇p+ρg+∇∙τ+f_σ
8. Go to the next time step
when I use the level set method, the simulation result tends to diverge. So I wander what the matter is.
Thanks!
kevinLL is offline   Reply With Quote

Old   July 31, 2015, 11:28
Default
  #2
New Member
 
Mostafa Mobli
Join Date: Feb 2015
Posts: 8
Rep Power: 11
moblimostafa is on a distinguished road
Quote:
Originally Posted by kevinLL View Post
Hello,
I want to use the level set method to investigate the multiphase flow based on openFoam software, but unfortunately failed. Could someone please give me some advice? Thank you very much!
Here is what I have done:
1. Define the level set function φ as a volScalarFields in OpenFoam
2. Give the level set function φ an initial value using the funkySetFields, as it’s a distance function from the interface. Here is the formula:
φ_0=(x-a)2+〖(y-b)〗^2+(z-c)2-r
3. Start the time loop
4. Try to solve the level set function like this:
fvScalarMatrix levelsetphiEqn
(
fvm::ddt(levelsetphi) + fvm::div(phi, levelsetphi)
);
levelsetphiEqn.solve();

5. Update the transport properties:
density: ρ=ρ_f H+ρ_g (1-H)
viscosity: μ=μ_f H+μ_g (1-H)

6. Reinitialize the level set function with the following equation:
{■(φ_τ=sign(φ_0)(1-|∇φ|)@φ(x,0)=φ_0 )┤
7. Solve the conservation equantion: ∇∙u=0
ρ Du/Dt=-∇p+ρg+∇∙τ+f_σ
8. Go to the next time step
when I use the level set method, the simulation result tends to diverge. So I wander what the matter is.
Thanks!

Hi Kevin

Where you able to fix the problem you had in the implementation? How did you initialize the problem with funkysetfields? I have been trying to do so but I have been unsuccessful so far.
moblimostafa is offline   Reply With Quote

Old   August 1, 2015, 09:53
Default
  #3
Senior Member
 
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 13
wenxu is on a distinguished road
Hi, Mostafa Mobli,

Now, I am implementing the reinitialization step. Did you succeed about this step?

Regards,
Wen
wenxu is offline   Reply With Quote

Old   August 1, 2015, 10:25
Default
  #4
Senior Member
 
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 13
wenxu is on a distinguished road
Hi, could you describe the reinitialization step more clearly? I do not know how you initialize the G field. I know that FMM is one of the choice to reinitialize the distance field.

Code:
6. Reinitialize the level set function with the following equation:
{■(φ_τ=sign(φ_0)(1-|∇φ|)@φ(x,0)=φ_0 )┤

Regards,
Wen
wenxu 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
[snappyHexMesh] Boundary layer in a pipe Clementhuon OpenFOAM Meshing & Mesh Conversion 6 March 12, 2012 13:41
Conservative Level Set Method mbfranklin@gmail.com Main CFD Forum 3 November 4, 2011 04:44
level set method for simulating detonation Amir Main CFD Forum 4 July 31, 2008 16:13
Problem on high density ratio in Level Set method Kai Yan Main CFD Forum 10 December 25, 2007 07:12
Env variable not set gruber2 OpenFOAM Installation 5 December 30, 2005 05:27


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