|
[Sponsors] |
Reinitialize velocity field during simulation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 18, 2013, 06:28 |
Reinitialize velocity field during simulation
|
#1 |
Member
Join Date: Sep 2012
Posts: 30
Rep Power: 14 |
Dear Foamers,
I am using the interFoam solver to simulate the fall of a water drop in an oil phase. For small droplets, I have trouble with initializing the case: I am using the funkySetFields to create the initial drop: Code:
funkySetFields -field alpha1 -expression 1 -time 0 -keepPatches -condition "pow(pos().x-(20*0.000100/2),2)+pow(pos().y-(0.9*60*0.000100),2)<=pow((0.000100/2),2)" My idea was to simulate the first time step, keep the field for the phase fraction alpha1 but set the velocity field back to zero so gravity can act on the drop undisturbed. Does anyone know how to procede? Thank you a lot! |
|
March 19, 2013, 10:48 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Add this function object: Code:
clearVelocity { type manipulateField; variables ( "startTime=0.1;" ); mask "time()<startTime"; expression "vector(0,0,0)"; fieldName U; }
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
March 19, 2013, 12:00 |
|
#3 |
Member
Join Date: Sep 2012
Posts: 30
Rep Power: 14 |
Thank you!
Another idea I got was to initialize the pressure field to be what is expected from theory, by using the formula for pressure difference due to surface tension: Young Laplace Equation I believe this can easily be done with funkySetFields for cells within the drop. I suspect it will avoid the snapping of the drop into place, but haven't implemented any of those suggestions yet. I'll keep this post up to date ;-) |
|
March 19, 2013, 12:15 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
March 20, 2013, 13:56 |
|
#5 |
Member
Join Date: Sep 2012
Posts: 30
Rep Power: 14 |
For your information:
it is possible to reinitialize the velocity field by using funkySetFields: Code:
funkySetFields -field U -expression 'vector(0,0,0)' -time 0.01 -keepPatches One can also force the initial pressure difference to be 28 for example: Code:
funkySetFields -field p_rgh -expression 28 -time 0 -keepPatches -condition "alpha1==1" Best of luck! |
|
March 31, 2013, 22:42 |
|
#6 | |
Member
Guifan Li
Join Date: Apr 2011
Location: New York City, U.S.
Posts: 96
Rep Power: 15 |
Hi emirust,
I am currently working on a similar project like yours, simulating a droplet of oil phase (radius is around 2mm) fall into a water tank. However, the results seems to be bad since when I use setFields to initialise the droplet; it seems to be out of its capacilty to generate such a small droplet. I am trying to use funkySetFields to do it, but the resource, where funkySetFields package can be downloaded, has been removed from OpenFOAMWiki. Just wondering, where did you get your funkySetFields package if you can tell me? Thanks in advance and hope we can have further discussion later. BTW, have you successfully used the snapphyHexMesh to refine the area around your droplet? Best, Quote:
|
||
April 1, 2013, 04:51 |
|
#7 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
see this thread of mine to download swak4foam.inside swak4foam there is funkysetfiels.↲http://www.cfd-online.com/Forums/ope...ybc-of220.html
|
|
April 7, 2013, 10:20 |
|
#8 |
Member
Join Date: Sep 2012
Posts: 30
Rep Power: 14 |
Hey!
What do you mean by out of capacity? Have you looked at the interface tension and viscosity ratio of the two phases? This may be the reason for the bubble disapearing, if you are still in a test phase.. To initialize the fields, you must install the swak4foam package (groovyBC, funkySetFields and others have now been put together in swak4Foam). funkySetFields is included in it, and I believe you can find information on how to install it Here is my blockMeshDict: Code:
convertToMeters 1; vertices ( ( 0 0 0 ) //0 ( 0.01 0 0 ) //1 ( 0.01 0.04 0 ) //2 ( 0 0.04 0 ) //3 ( 0 0 5e-07 ) //4 ( 0.01 0 5e-07 ) //5 ( 0.01 0.04 5e-07 ) //6 ( 0 0.04 5e-07 ) //7 ); blocks ( hex (0 1 2 3 4 5 6 7) (30 120 1) simpleGrading (1 1 1) //1 ); edges ( ); boundary ( topWall { type patch; faces ( (3 7 6 2) ); } leftWall { type wall; faces ( (0 4 7 3) ); } rightWall { type wall; faces ( (2 6 5 1) ); } bottomWall { type wall; faces ( (1 5 4 0) ); } front { type empty; faces ( (4 5 6 7) ); } back { type empty; faces ( (0 3 2 1) ); } Code:
actions ( { name c0; type cellSet; action clear; } { name c0; type cellSet; action new; source boxToCell; sourceInfo { box (0.0028 0 -1) (0.0072 0.04 1); } } ); E. |
|
April 7, 2013, 23:14 |
|
#9 |
Member
Guifan Li
Join Date: Apr 2011
Location: New York City, U.S.
Posts: 96
Rep Power: 15 |
Hi Emirust,
Thanks for your reply and your code. I have implement my mesh and gave it a try. But when the mesh size is small, like droplet in mm, the simulation seems to be quite bad. The time step Delta T goes to some number like 1.5e-21 or even smaller. If I use a constant time step like 0.0001, the courant number would go to very large. My case is actually 3D, I built up a cylinder and define bottom half is water, and funkySet to create a droplet on top of the water surface( inside the upper air phase) Besides, I am not using MultiphaseInterFoam, so I think I don't need to take viscosity ratio into consideration( correct me if i am wrong), for the interfacial tension, I gave it a value (water oil) 0.025 (air water) 0.07 (air oil) 0.045. Not sure whether you have met the same problem as mine, if yes, could you please give some suggestions? Appreciated that. Best, |
|
April 8, 2013, 06:03 |
|
#10 |
Member
Join Date: Sep 2012
Posts: 30
Rep Power: 14 |
Hello,
I based my case on the damBreak tutorial, so I am using the interFoam solver. The fact that the Courant number gets so small is probably a sign that the phases are changing a lot, and thus require smaller time step: for my case the time step is adjusting itself automatically (adjustTimeStep in controlDict). Typically this happened to me when I used a interfacial tension far too small, which caused by drop to "pop" and disapear. Regarding the properties of the fluids: I specify it in the transportProperties file. There I need to specify both the viscosities of the phases and the interfacial tension between the two phases. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Editing chtMultiRegionFoam to not solve velocity field | tH3f0rC3 | OpenFOAM | 18 | January 24, 2020 17:39 |
interpreting velocity field | asharma | OpenFOAM Post-Processing | 2 | October 9, 2010 02:19 |
Neumann pressure BC and velocity field | Antech | Main CFD Forum | 0 | April 25, 2006 03:15 |
velocity field divergence? | gh | FLUENT | 0 | July 6, 2005 12:10 |
Variables Definition in CFX Solver 5.6 | R P | CFX | 2 | October 26, 2004 03:13 |