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

How to create a free surface application in Openfoam ?

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

Like Tree3Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 27, 2011, 23:29
Default How to create a free surface application in Openfoam ?
  #1
New Member
 
Jindo
Join Date: Mar 2011
Location: Germany
Posts: 25
Rep Power: 15
phuchuynh is on a distinguished road
i am new user of OpenFoam (1.7.1) and I want to creat a free surface application.
For example : in backward facing, I want to creat a free upper surface ?

thank you !

phuchuynh
phuchuynh is offline   Reply With Quote

Old   July 28, 2011, 03:28
Default
  #2
Senior Member
 
Elvis
Join Date: Mar 2009
Location: Sindelfingen, Germany
Posts: 620
Blog Entries: 6
Rep Power: 24
elvis will become famous soon enough
Hello,

In my opinion
the dam break case is a free surface application
http://repo.or.cz/w/OpenFOAM-1.7.x.g...minar/damBreak
http://repo.or.cz/w/OpenFOAM-1.7.x.g...erFoam/laminar

or tank sloshing
https://openfoam-extend.svn.sourcefo...ckFoam/tank3D/ but this is OpenFOAM-1.6-ext

so have a look at interFoam or multiphaseInterFoam
phuchuynh likes this.
elvis is offline   Reply With Quote

Old   July 28, 2011, 14:55
Default
  #3
Senior Member
 
Kent Wardle
Join Date: Mar 2009
Location: Illinois, USA
Posts: 219
Rep Power: 21
kwardle is on a distinguished road
Right. Just take one of the backward step example cases and tweak it to run with interFoam. Take a look at the damBreak tutorial for interFoam to see what files you need (e.g. you need to make an alpha1 field and may need to change the name of p to p_rgh).

You should be able to set the alpha1 fraction on the inlet to 1 and start with the volume empty and watch it fill up. You may have to tweak the outlet BC (perhaps like the top boundary on damBreak--although I am not sure if this will work correctly. There may be a better BC type for this sort of outlet (half-full liquid flow).

Hope this is useful.
phuchuynh likes this.
kwardle is offline   Reply With Quote

Old   August 2, 2011, 07:40
Default
  #4
New Member
 
Jindo
Join Date: Mar 2011
Location: Germany
Posts: 25
Rep Power: 15
phuchuynh is on a distinguished road
Plsease
I want to creat a free surface application for solvers ..basic/scalarTransportFoam/pitzDaily.
I replaced the words in library blockmeshDict " wall upperWall " by " patch atmosphere" ; in libray boundary and T , U " upper Wall " by "atmosphere " , But the result remains unchanged. So how do I do ?
Plz ! help me ?
thanks !
phuchuynh is offline   Reply With Quote

Old   August 2, 2011, 10:51
Default
  #5
Senior Member
 
Kent Wardle
Join Date: Mar 2009
Location: Illinois, USA
Posts: 219
Rep Power: 21
kwardle is on a distinguished road
Hi--
Sounds like all you have done is change the name of the boundaries. You need to change the names in constant/polyMesh/boundary (or rerun blockMesh with your modified blockMeshDict). You also must change the boundary conditions in the 0 directory. You will need to copy the alpha1 file from a damBreak case and change the BC names to match the new case. You will need to add an inlet (which will be type fixedValue) for the inlet. You'll need to update U and p (as p_rgh) as well. You will also need to copy the fvSolution and fvSchemes files from the damBreak case into the new one (alternatively, you can just copy the whole damBreak case and copy in your blockMeshDict from the back step case and start modifying from there). Does this make sense? If you make some changes and try to run the case and get some errors, don't give up, just take a look at what they say--usually they will tell you what is missing so you can make it work.
Regards,
Kent
kwardle is offline   Reply With Quote

Old   August 3, 2011, 15:34
Default
  #6
New Member
 
Jindo
Join Date: Mar 2011
Location: Germany
Posts: 25
Rep Power: 15
phuchuynh is on a distinguished road
thank Kent for your interest to my topic !
I copied the alpha1, alpha1.org,p_rgh, U files form a damBreak/0 directory and to change the boundary conditions. I also copied the fvSolution and fvSchemes files from the damBreak case into the new case.
However, appeared some errors
Code:
--> FOAM FATAL IO ERROR: 
keyword SIMPLE is undefined in dictionary "/home/phucdaigia/OpenFOAM/root-1.7.1/run/tutorials/basic/scalarTransportFoamB/pitzDaily/system/fvSolution"

file: /home/phucdaigia/OpenFOAM/root-1.7.1/run/tutorials/basic/scalarTransportFoamB/pitzDaily/system/fvSolution from line 22 to line 58.

    From function dictionary::subDict(const word& keyword) const
    in file db/dictionary/dictionary.C at line 456.

FOAM exiting
Plz, help me ? thanks ....
Attached Files
File Type: gz scalarTransportFoamB.tar.gz (3.0 KB, 29 views)
phuchuynh is offline   Reply With Quote

Old   August 4, 2011, 10:32
Default
  #7
Senior Member
 
Kent Wardle
Join Date: Mar 2009
Location: Illinois, USA
Posts: 219
Rep Power: 21
kwardle is on a distinguished road
Inlet on alpha1 should be:

type fixedValue;
value uniform 1;

and for U you need to specify a inlet flow velocity--right now it is (0 0 0).

As for your error message, what solver are you trying to run? You should be running interFoam (but from the error message I am guessing you are not) which means in your system/fvSolution file it should say "PISO" where it now says SIMPLE. You should just copy the fvSolution, fvSchemes, and controlDict files from the damBreak tutorial for interFoam. You will also need the files from constant there too (transportProperties, turbulenceProperties, g).

Hope this helps.
kwardle is offline   Reply With Quote

Old   August 9, 2011, 03:39
Default
  #8
New Member
 
Jindo
Join Date: Mar 2011
Location: Germany
Posts: 25
Rep Power: 15
phuchuynh is on a distinguished road
Thank for your help ! I did as your request and received this result. However, I haven't seen any change of the free surface ?

Please, You can help me ?
Attached Files
File Type: zip scalarTransportFoamPhuc.zip (11.1 KB, 31 views)
File Type: gz result.tar.gz (90.8 KB, 34 views)
phuchuynh is offline   Reply With Quote

Old   August 11, 2011, 17:07
Default
  #9
Senior Member
 
Kent Wardle
Join Date: Mar 2009
Location: Illinois, USA
Posts: 219
Rep Power: 21
kwardle is on a distinguished road
Hi,
First of all, what are you plotting in your attached results? Looks like the velocity or pressure field not the volume fraction field (alpha). Also, unless you sent me an older version of the case, you did not make the changes I suggested. Here is what you need to do:

- copy fvSolution, fvSchemes, and transportProperties from the damBreak tutorial for interFoam

- for your setFieldsDict, change the patch for alpha1 to something useful such as
box (-1 0 -1) (0 1 1);
which will patch alpha1 into the inlet section

- fix 0/p_rgh so it has frontAndBack instead of defaultFaces

- I would also set 0/U on the inlet to be something smaller say (1 0 0) instead of 10

This will work with interFoam. I have tried it and attached is an animation of the results out to t=0.75s. As you can see, the outlet BC is a little wonky--basically, your outlet is not an outlet, but a wall and so stuff is flowing up the wall and out the top (never to return...).

Good luck!
kwardle is offline   Reply With Quote

Old   August 11, 2011, 23:59
Default
  #10
New Member
 
Jindo
Join Date: Mar 2011
Location: Germany
Posts: 25
Rep Power: 15
phuchuynh is on a distinguished road
Hi Kwardle,
I user OF 1.7.1.
I sent you sent me an older version of the case, and my result was run as above.
thanks !
Attached Files
File Type: zip scalarTransportFoam.zip (8.7 KB, 36 views)
phuchuynh is offline   Reply With Quote

Old   August 12, 2011, 09:29
Default
  #11
Senior Member
 
Kent Wardle
Join Date: Mar 2009
Location: Illinois, USA
Posts: 219
Rep Power: 21
kwardle is on a distinguished road
I tried this with interFoam in 1.7.x and see you are still missing PISO in fvSolutions which means you haven't made all the changes. Please see my previous post. This tells you exactly what changes you need to make to get this working with interFoam. Also, you will want to patch in alpha1 using setFields as I mentioned above so that the solution starts with a little liquid inside the inlet BC--if you don't do this, sometimes you can get screwy startup.
kwardle is offline   Reply With Quote

Old   August 15, 2011, 05:22
Default
  #12
New Member
 
Jindo
Join Date: Mar 2011
Location: Germany
Posts: 25
Rep Power: 15
phuchuynh is on a distinguished road
Hi kwardle !

I run the solver with interFoam, and the result appeared free surface.
Thank for your help and Thank you very much !

PhucHuynh
phuchuynh is offline   Reply With Quote

Old   September 7, 2011, 13:29
Default
  #13
Member
 
Mohammad Fereshtehpour
Join Date: Jul 2011
Location: Iran
Posts: 61
Rep Power: 14
MOHAMMAD67 is on a distinguished road
Send a message via Skype™ to MOHAMMAD67
Dear kwardle, Hi
thanks for your help in advance. I really learn a lot from your posts.
I want to know how I can simulate free surface flow in circular pipe. What changes I should implement in setFieldDict to achieve this? Is there any files I should change( e.g. inlet in boundary field)?
MOHAMMAD67 is offline   Reply With Quote

Old   September 8, 2011, 03:49
Default
  #14
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
Quote:
Originally Posted by MOHAMMAD67 View Post
Dear kwardle, Hi
thanks for your help in advance. I really learn a lot from your posts.
I want to know how I can simulate free surface flow in circular pipe. What changes I should implement in setFieldDict to achieve this? Is there any files I should change( e.g. inlet in boundary field)?
set field only support a few distribution for geometry for example box or sphere or ... ! i suggest you using funkySetFields which can be found in openFOAM wiki
nimasam is offline   Reply With Quote

Old   September 8, 2011, 07:31
Default free surface flow in pipe
  #15
Member
 
Mohammad Fereshtehpour
Join Date: Jul 2011
Location: Iran
Posts: 61
Rep Power: 14
MOHAMMAD67 is on a distinguished road
Send a message via Skype™ to MOHAMMAD67
Hi nima
Before involving in the funkySetfField I want to know how I can model free surface flow? I successfully solved the problem in this discussion. but I couldn't make free surface flow for this specific problem. what should I do in this smple 2D problem?
MOHAMMAD67 is offline   Reply With Quote

Old   September 8, 2011, 15:04
Default
  #16
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
whats ur mean how?
for simulation of free surface flow, if you use interFoam, actually u are going to simulate a two phase flow and track interface between them. interFoam uses VOF method, in this method a scalar function (alpha) defines each phase! dam break case is discussed above can be found in tutorials, what else do u like to know?
nimasam is offline   Reply With Quote

Old   September 8, 2011, 15:46
Default free surface flow boundary condition
  #17
Member
 
Mohammad Fereshtehpour
Join Date: Jul 2011
Location: Iran
Posts: 61
Rep Power: 14
MOHAMMAD67 is on a distinguished road
Send a message via Skype™ to MOHAMMAD67
Dear nima
I didn't state my question clearly. I mean how i can change the inlet boundary condition to have free surface flow in pipe. It's better to see this picture. I intend to model it.
MOHAMMAD67 is offline   Reply With Quote

Old   September 8, 2011, 16:28
Default
  #18
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
first
1) set up ur simulation geometry ( pipe and internal barrier)

2) for inlet :
U : fixedValue
P : zeroGradient
alpha: fixedValue 0.5 or nonuniform with groovyBC
for wall :
U : fixedValue uniform (0 0 0)
P : zeroGradient or bouyant pressure
alpha : zeroGradient
for Outlet:
U : zero Gradient or outletInlet
P : fixedValue
alpha : zeroGradient

3) you can initialize field in time zero with funkySetFields
nimasam is offline   Reply With Quote

Old   September 12, 2011, 01:34
Default Outlet Pressure?
  #19
Member
 
Mohammad Fereshtehpour
Join Date: Jul 2011
Location: Iran
Posts: 61
Rep Power: 14
MOHAMMAD67 is on a distinguished road
Send a message via Skype™ to MOHAMMAD67
Dear Nima, Hi
I've done what you said for the case discussed in this thread ( two phase flow with the geometery of Pitzdaily problem). Fortunately It worked but I think pressure outlet for my case is not fixed value. The pressure above the surface in the whole system is atmospheric pressure. Viewing the results near the outlet confirms this claim.
So what should I do? Should I implemet hydrostatic pressure? How?


FS2-74.jpg

FS2-82.jpg
MOHAMMAD67 is offline   Reply With Quote

Old   September 12, 2011, 09:56
Default
  #20
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
use bouyantPressure in out let!
i guess it will consider the variation of pressure due to gravity direction! but im not sure
if it does not work you can implement it easily with groovyBC.
nimasam is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Free Surface Ship Flow timfranke OpenFOAM Running, Solving & CFD 322 March 3, 2021 09:04
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 05:36
free surface around a ship hull Stephy OpenFOAM Running, Solving & CFD 12 April 24, 2012 01:12
Porous media in free surface application chiggins OpenFOAM Running, Solving & CFD 0 July 3, 2008 11:25
Modeling Free Surface Flows Elliot Schwartz Main CFD Forum 5 August 25, 1998 21:03


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