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

Injection of a fluid into a cavity

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 17, 2008, 05:07
Default Hi all, I would like to us
  #1
Member
 
Francesco Boschetto
Join Date: Mar 2009
Location: Italy
Posts: 56
Rep Power: 17
francesco_b is on a distinguished road
Hi all,

I would like to use OF to simulate the injection of a fluid into a cavity. I tried to use interFoam but I got some issues about BC, I've read some threads about this but still I don't understand how to write the correct BC and initial values. My geometry is like the one in the cavity tutorial, but i have 3 walls, 2 empty and 1 inlet. Am I missing something? I tried also to put an outlet but still nothing happened, the fluid doesn't move.

I don't know how to upload files, if you tell me I can put my test_case here.

Thanks in advance

Francesco
francesco_b is offline   Reply With Quote

Old   January 18, 2008, 12:53
Default I have put a outlet, and now I
  #2
Member
 
Francesco Boschetto
Join Date: Mar 2009
Location: Italy
Posts: 56
Rep Power: 17
francesco_b is on a distinguished road
I have put a outlet, and now I'm able to see the fluid filling my domain, but I still got problems when the fluid reach this boundary, how can I solve it?

Someone could give me a hint?

Thanks in advance

Francesco
francesco_b is offline   Reply With Quote

Old   January 18, 2008, 13:21
Default I'm trying to use interfoam to
  #3
Senior Member
 
Daniele Vicario
Join Date: Mar 2009
Location: Novara, Italy
Posts: 142
Rep Power: 17
danvica is on a distinguished road
I'm trying to use interfoam too.

Maybe we can help each other. At the moment I've stability problems just with some geometries/meshes.

Which kind of problem (stability, gamma/pd/U values, ...) ?
__________________
Daniele Vicario

blueCFD2.1 - Windows 7
danvica is offline   Reply With Quote

Old   January 21, 2008, 05:35
Default Hi Daniele, my problem is p
  #4
Member
 
Francesco Boschetto
Join Date: Mar 2009
Location: Italy
Posts: 56
Rep Power: 17
francesco_b is on a distinguished road
Hi Daniele,

my problem is probably the solver. I would like to simulate the injection of a fluid into a cavity with OF, I tought that interFoam could be a good choice for the possibility of interface tracking. Probably it is not a good choice; the other softwares I have seen use this strategy: they consider the cavity empty and pressure = 0, then they fill it with the fluid, which has a positive pressure, computing the movement of the interface.

My problem with interFoam are due to the outlet, I would like to have a close cavity. InterFoam is an incompressible solver, so it needs an outlet for the air which is in the cavity. Maybe it would be better to use a compressible solver, what do you think? Can rhopSonicFoam treat a problem like this one? Have you found a way to overcome the problem of the outlet?
francesco_b is offline   Reply With Quote

Old   January 21, 2008, 07:21
Default Interfoam solvers (RAS and LES
  #5
Senior Member
 
Daniele Vicario
Join Date: Mar 2009
Location: Novara, Italy
Posts: 142
Rep Power: 17
danvica is on a distinguished road
Interfoam solvers (RAS and LES) involve two incompressible fluids. Basically what is entering in the computational domain has to go out somewhere. As far as I understand pressure=0 in operfoam doesn't mean "empty". Pressure is just an offset value. What really means is pressure difference between different points.

Changing to compressible doesn't help too much. You don't want to compress something. Just fill in the empty space.

I don't know rhopSonicFoam. I just remember an older thread in which Mr.Jasak (if i remember right) said that at that moment there were no solver for the fluid/empty case.

I'll try to search that thread. In the meanwhile i'll be happy if someone more involved in OF would confirm/refuse my opinion.
__________________
Daniele Vicario

blueCFD2.1 - Windows 7
danvica is offline   Reply With Quote

Old   January 21, 2008, 07:26
Default I forget to ask you which is e
  #6
Senior Member
 
Daniele Vicario
Join Date: Mar 2009
Location: Novara, Italy
Posts: 142
Rep Power: 17
danvica is on a distinguished road
I forget to ask you which is exacly your case.

In all the real cases I'm aware of there's always an outlet path for the fluid. "Empty" is not a common situation, I believe.
__________________
Daniele Vicario

blueCFD2.1 - Windows 7
danvica is offline   Reply With Quote

Old   January 21, 2008, 09:17
Default Hi Daniele, what I've told
  #7
Member
 
Francesco Boschetto
Join Date: Mar 2009
Location: Italy
Posts: 56
Rep Power: 17
francesco_b is on a distinguished road
Hi Daniele,

what I've told you is the behavior of a normal software for simulating molding, like Flow3D. I know that in a real case there are always outlets for the air, but for my purpose I don't want neither need to know where they are.
If there are no solver at the moment for doing this, how do you solve this problem with interFoam? I'm curious about this since my results are not good.

Best Rigards

Francesco
francesco_b is offline   Reply With Quote

Old   January 21, 2008, 11:47
Default Thanks for the explanation.
  #8
Senior Member
 
Daniele Vicario
Join Date: Mar 2009
Location: Novara, Italy
Posts: 142
Rep Power: 17
danvica is on a distinguished road
Thanks for the explanation.

Personally I'm using rasinterfoam to study the flow of water into kitchen/bathroom faucets. So in my cases I'm force to have an outlet.

The only big problem I have is concerning the best schema/solution setup in order to avoid instability during all the simulation.

Regarding your case what I would try is:

1. Add an outlet in a non critical area. That's not easy because it has to be big enought to let the secondary fluid go out without interferring with the main fluid.

2. Use icoFoam or turbFoam. This are solvers for incompressible single-fluid. You can't add gravity force, that however you don't need i think.
I never tried them without an outlet, but if you use a pressure based inlet maybe it can work.
__________________
Daniele Vicario

blueCFD2.1 - Windows 7
danvica is offline   Reply With Quote

Old   January 21, 2008, 12:49
Default Hi Daniele, I've tried the
  #9
Member
 
Francesco Boschetto
Join Date: Mar 2009
Location: Italy
Posts: 56
Rep Power: 17
francesco_b is on a distinguished road
Hi Daniele,

I've tried the first solution but it is not that simple, even in a simple case the result is not good, the fluid tends to exit through the outlet.

For the second suggestion, the problem is that the domain of the fluid is a part of the calculus domain and I don't know how to use single-fluid solver for this computation, especially for the calculation of the interface, which is the aim of my simulation.

I think there are 2 ways to solve my problem:

1) Use a 2-phase solver (filling fluid and gas), compressible so that I could compress the low-density gas which is in the cavity at the beginning of the simulation, till my fluid fills the whole cavity.

2) maybe easier to compute: For each step accordingly to the previous geometry of the interface and the cavity, find the newer interface, than calculate the flux of the flow in the subdomain and go on till the cavity is filled.

I couldn't imagine how to do this in practical, is there anybody who could help me giving me any advice about my two ways to solve the problem?

Thanks in advance

Francesco
francesco_b is offline   Reply With Quote

Old   January 22, 2008, 04:47
Default Hello all, Just a thought -
  #10
pad
New Member
 
PA
Join Date: Mar 2009
Posts: 25
Rep Power: 17
pad is on a distinguished road
Hello all,

Just a thought - don't know if it is even possible since I have not worked with OpenFoam yet (very interested in the possibilities of OF though).

What if you treat all boundaries as outlets and once the fluid reaches the boundary (or the vicinity of it) you switch it to a wall boundary?

Regards,
Per
__________________
Regards,
Per
pad is offline   Reply With Quote

Old   January 22, 2008, 05:54
Default Hi Per, Thanks for your sug
  #11
Member
 
Francesco Boschetto
Join Date: Mar 2009
Location: Italy
Posts: 56
Rep Power: 17
francesco_b is on a distinguished road
Hi Per,

Thanks for your suggestion, It could be a nice idea, I could test it, but this is not what I want.

I've thought about realizing the first way, I'm trying to use cavitatingFoam in order to have a 2 phase compressible solver. Is there someone who could tell me if I'm in the right or wrong way?

Thanks in advance

Francesco
francesco_b is offline   Reply With Quote

Old   January 22, 2008, 06:55
Default Hi all, I've tried to use
  #12
Member
 
Francesco Boschetto
Join Date: Mar 2009
Location: Italy
Posts: 56
Rep Power: 17
francesco_b is on a distinguished road
Hi all,

I've tried to use cavitatingFoam, but I received neither an error message nor the computation of the simulation:

/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.4.1 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

Exec : cavitatingFoam . injection2
Date : Jan 22 2008
Time : 11:50:11
Host : biprox
PID : 11582
Root : /home/area3/OpenFOAM/area3-1.4.1/run/tutorials/cavitatingFoam
Case : injection2
Nprocs : 1
Create time

Create mesh for time = 0

Reading thermodynamicProperties

Reading transportProperties

Reading field p

Creating compressibilityModel

Selecting compressibility model linear
Reading field U

Reading/calculating face flux field phiv

Reading/calculating face flux field phi

phiv Courant Number mean: 1.71053e-06 max: 0.00104 acoustic max: 1.50804

Starting time loop


end


What's wrong? Please give me a hint or an advice to solve this situation

Thanks in advance

Francesco
francesco_b is offline   Reply With Quote

Old   January 31, 2008, 06:45
Default Hi All, after many try I th
  #13
Member
 
Francesco Boschetto
Join Date: Mar 2009
Location: Italy
Posts: 56
Rep Power: 17
francesco_b is on a distinguished road
Hi All,

after many try I think that interFoam can be a good choice, but I have to implement the boundary condition that Per suggested, i.e. boundaries as outlets untill the fluid with gamma >= 0.5 reaches the cell close to the boundary one, after that it switches that face to wall BC.

Any suggestions or hints about how to do it?

Thanks in advance

Francesco
francesco_b is offline   Reply With Quote

Old   February 20, 2008, 12:07
Default Hi, I think you have to do
  #14
Senior Member
 
Billy
Join Date: Mar 2009
Posts: 167
Rep Power: 17
billy is on a distinguished road
Hi,

I think you have to do a gradual switch or else you might get numerical instabilities.

What you need to do is create a new wall BC.
billy is offline   Reply With Quote

Old   February 20, 2008, 13:01
Default Hi Billy, I've tried to mo
  #15
Member
 
Francesco Boschetto
Join Date: Mar 2009
Location: Italy
Posts: 56
Rep Power: 17
francesco_b is on a distinguished road
Hi Billy,

I've tried to modify the outletInlet BC but I'm not expert of C++ and I don't know how to retrieve the value of gamma in the cell close to the boundary patch. Does anybody know how to do it?

If you want I can send you my files, I'm sorry but I'm not able to upload them.

For your suggestion of a gradual switch, do you have any hint on how to perform this? Is there already any exemple of this somewhere in the code?

Thanks in advance

Francesco
francesco_b is offline   Reply With Quote

Old   February 22, 2008, 06:32
Default I would like to try and implem
  #16
Senior Member
 
Billy
Join Date: Mar 2009
Posts: 167
Rep Power: 17
billy is on a distinguished road
I would like to try and implement this eventually but I am short of time at the moment.

I don't think this is anywhere in the code. I would like also to hear comments from other people in this forum.
billy is offline   Reply With Quote

Old   February 26, 2008, 09:31
Default I've implemented the boundary
  #17
Member
 
Francesco Boschetto
Join Date: Mar 2009
Location: Italy
Posts: 56
Rep Power: 17
francesco_b is on a distinguished road
I've implemented the boundary condition, it should work, the problem is now that I don't know how to test it, I mean I've done some tests but results seems to be a bit strange.

My BC acts like a filter based on gamma, that is when gamma in the cell near the patch is < 0.5 there is an outflow, otherwise there is a wall.

Can you tell me which test to perform to evaluate if my boundary condition is correct?

Thanks in advance

Francesco
francesco_b is offline   Reply With Quote

Old   February 26, 2008, 11:02
Default Dear Francesco, if your are
  #18
caw
Member
 
Christian Winkler
Join Date: Mar 2009
Location: Mannheim, Germany
Posts: 63
Rep Power: 17
caw is on a distinguished road
Dear Francesco,

if your are willing to share your BC, i would give you a simple test case or perform the test myself.
Whatever you like.

Kind regards
Christian
caw is offline   Reply With Quote

Old   February 27, 2008, 07:15
Default Francesco, i have a simple
  #19
caw
Member
 
Christian Winkler
Join Date: Mar 2009
Location: Mannheim, Germany
Posts: 63
Rep Power: 17
caw is on a distinguished road
Francesco,

i have a simple test case for you. Here is an image:

There is a circular inlet at the lower end of the cavity, there i fluid (gamma = 1) is injected into the cavity. The grey surface is called wall and behaves like a wall. The green surface is called outlet but defined as wall for now. The blue surface is called upper_outlet and acts as an outlet. So in the simulation the fluid level rises with advancing time against gravity.

For your case i would suggest to switch the upper_outlet to wall. Then use your new BC for the surface called outlet. Now, fluid two should be able to leave the domain while the injected fluid one is held back and rises in the same way as mentioned above.

Test case for interFoam with animation frames:


Would you please share your BC so a can perform some tests as well?

Thanks and regards
Christian
caw is offline   Reply With Quote

Old   February 27, 2008, 07:20
Default Francesco, i have a simple
  #20
caw
Member
 
Christian Winkler
Join Date: Mar 2009
Location: Mannheim, Germany
Posts: 63
Rep Power: 17
caw is on a distinguished road
Francesco,

i have a simple test case for you. Here is an image:

There is a circular inlet at the lower end of the cavity, there i fluid (gamma = 1) is injected into the cavity. The grey surface is called wall and behaves like a wall. The green surface is called outlet but defined as wall for now. The blue surface is called upper_outlet and acts as an outlet. So in the simulation the fluid level rises with advancing time against gravity.

For your case i would suggest to switch the upper_outlet to wall. Then use your new BC for the surface called outlet. Now, fluid two should be able to leave the domain while the injected fluid one is held back and rises in the same way as mentioned above.

The test case for interFoam is to large to post it here. If you want it, just drop me an email.

Would you please share your BC so a can perform some tests as well?

Thanks and regards
Christian
caw 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
fluid pressure in cavity Nishan CFX 0 November 2, 2008 19:51
lid driven cavity sudha Main CFD Forum 5 July 11, 2007 04:05
ANSYS problem in solving fluid fluid interaction Fayyaz CFX 0 July 24, 2006 10:03
Heat transfer for fluid-fluid interface lentil FLUENT 0 March 31, 2005 16:25
Help on cavity flow Pendy Main CFD Forum 17 July 18, 2001 00:34


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