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

parasitic currents

Register Blogs Community New Posts Updated Threads Search

Like Tree50Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 12, 2012, 07:05
Default
  #121
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
Hi anton,
i think i do not understand well your first question. what do you mean with "start filtering"?. I would first define

grad(pc)-(grad(pc) dot ns)ns

at the cell centers, then i would interpolate it to face centers and dot product with "nf". We get a surfaceScalarField define at the face centers that can be multiplied with Cfc (which is a constant) and deltasf/(mag(deltasf+eps)) which is also a surfaceScalarField. Once fcf_filtered is calculated, fcf can be updated using (21).
I would put the filtering just after the capillary pressure equation in interFoamSSF.C

I think eps is used just to avoid division by zero. I would put some small numbers such as 1e-6/1e-8.

Since neither fcf nor grad(pc) change in PISO loop i would put the filtering of capillary fluxes just before UEqn.H and just after the previous filtering. I would define the total capillary flux phi_c as it is defined in pag.9, then i would apply the filtering and i would use directly phi_c in Ueqn.H and pEqn.H, instead of using fcf and grad(pc) separeted.

i am very sorry but i am preparing for a conference and i have no time to put my hands in the code now. i'll be back in 2 weeks


best

andrea
Mahmoud_aboukhedr likes this.
Andrea_85 is offline   Reply With Quote

Old   June 12, 2012, 07:49
Default
  #122
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
Quote:
Originally Posted by Andrea_85 View Post
[...] and deltasf/(mag(deltasf+eps)) which is also a surfaceScalarField. Once fcf_filtered is calculated, fcf can be updated using (21).
In my opinion this term is problematic, because it can lead to filtering normal to the interface if the curvature is small, see my previous post.

Quote:
Originally Posted by Andrea_85 View Post
I think eps is used just to avoid division by zero. I would put some small numbers such as 1e-6/1e-8.
Indeed, it's function is to avoid div0, but it's value is not unimportant in my opinion. In the end we compute "fcf = fcf - filter", and filter will get very large if deltasf is zero (because then we have 1/eps)! For now I've also opted for 1e-6 though.

Quote:
Originally Posted by Andrea_85 View Post
i am very sorry but i am preparing for a conference and i have no time to put my hands in the code now. i'll be back in 2 weeks
No worries, I'm grateful for the input you've provided. Enjoy the conference!

- Anton

P.S. I'll post some code later today.
Mahmoud_aboukhedr likes this.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   June 12, 2012, 08:11
Default
  #123
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
Filtering code is now online: http://code.google.com/r/akidess-interfoamfsf/
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   June 13, 2012, 04:20
Default
  #124
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
Results on the moving droplet case with filtering improved, but are nowhere as good as the reference :/
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   June 13, 2012, 07:13
Default
  #125
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
just a small comment, at pag.9 they say that fcf_average is the average of capillary forces over all faces where they are non-zero. Does cmptAv account for that?

best

andrea
Andrea_85 is offline   Reply With Quote

Old   June 13, 2012, 10:10
Default
  #126
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
I believe so. Btw, using the filtering algorithm as published on the repo, even the static droplet testcase doesn't work any more. After deactivating the filtering of fcf (but keeping it on phic) the static droplet case works again, so there's a problem with the computation of fcf_filter.
Mahmoud_aboukhedr likes this.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   August 1, 2012, 11:51
Default InterFoam: parasitic currents
  #127
New Member
 
M K Singh
Join Date: Sep 2009
Posts: 19
Rep Power: 17
mksingh is on a distinguished road
Dear Anton and Andrea,
Very nice discussion about parasitic currents. I am wondering if all the issues have been solved regarding spurious velocities at interfaces in interFoam. I am using OpenFoam 2.1.x to solve a 2-D ladle draining from the bottom (water +air system). The initial condition is shown in Figure attached (t=0 s). I am getting very strange results, please see the attached pictures for t=100,120, 170 s. As you can see that after certain time (t>100s) the liquid level remains constatnt and a strange waves are appearing at the inteface. I am doubting that is it effect of spurious velocities generated at intefcae? My boundary conditions are as follows:
=====================================
Valid fields:
volVectorField U
volScalarField p_rgh
volScalarField alpha1

patch: SENOUTLET
scalar p_rgh totalPressure
scalar alpha1 inletOutlet
vector U pressureInletOutletVelocity

wall: SENWALL
scalar p_rgh buoyantPressure
scalar alpha1 zeroGradient
vector U fixedValue

empty: SYM4
scalar p_rgh empty
scalar alpha1 empty
vector U empty

empty: SYM3
scalar p_rgh empty
scalar alpha1 empty
vector U empty

empty: SYM2
scalar p_rgh empty
scalar alpha1 empty
vector U empty

empty: SYM1
scalar p_rgh empty
scalar alpha1 empty
vector U empty

patch: TW
scalar p_rgh totalPressure
scalar alpha1 inletOutlet
vector U pressureInletOutletVelocity

wall: BW
scalar p_rgh buoyantPressure
scalar alpha1 zeroGradient
vector U fixedValue

wall: SW
scalar p_rgh buoyantPressure
scalar alpha1 zeroGradient
vector U fixedValue

======================================
Any suggestion in this regard? As suggested on forum, Now I have changed cAlpha=1 to see the effect of this on my result.
Thanks in advance.
M K Singh
Attached Images
File Type: jpg init_ladle_draining.jpg (14.6 KB, 107 views)
File Type: jpg ladle_t000100.jpg (44.6 KB, 148 views)
File Type: jpg ladle_t000120.jpg (42.6 KB, 113 views)
File Type: jpg ladle_t000170.jpg (41.5 KB, 134 views)
mksingh is offline   Reply With Quote

Old   August 1, 2012, 18:53
Default
  #128
New Member
 
Ali Q Raeini
Join Date: Feb 2010
Posts: 24
Rep Power: 16
aliqasemi is on a distinguished road
Dear Singh,

I was also used to get some non-physical velocities near the wall boundaries, much higher than the usual spurious velocities. You can call them whatever you like!
No, I think the filtering stuff are not still implemented in the interFoam code shipped with official openfoam, but you can check the links above. By the way, I am also going to release my code with a tutorial case as soon I find the time to clean it up, maybe in a few months time.

Bests, Ali
aliqasemi is offline   Reply With Quote

Old   August 3, 2012, 05:38
Thumbs up
  #129
Senior Member
 
Eelco van Vliet
Join Date: Mar 2009
Location: The Netherlands
Posts: 124
Rep Power: 19
eelcovv is on a distinguished road
Hi Ali

I just saw the paper of yours in J Comp Physics on this solver. Very nice work! Would be great if you would make your code public, I am sure a lot of us would like to use it. Are you going to post it on the forum? Would a 'pre-release' be possible?

Regards
Eelco
eelcovv is offline   Reply With Quote

Old   August 3, 2012, 07:09
Default Solution of my problem (emptying ladle)
  #130
New Member
 
M K Singh
Join Date: Sep 2009
Posts: 19
Rep Power: 17
mksingh is on a distinguished road
Quote:
Originally Posted by mksingh View Post
Dear Anton and Andrea,
Very nice discussion about parasitic currents. I am wondering if all the issues have been solved regarding spurious velocities at interfaces in interFoam. I am using OpenFoam 2.1.x to solve a 2-D ladle draining from the bottom (water +air system). The initial condition is shown in Figure attached (t=0 s). I am getting very strange results, please see the attached pictures for t=100,120, 170 s. As you can see that after certain time (t>100s) the liquid level remains constatnt and a strange waves are appearing at the inteface. I am doubting that is it effect of spurious velocities generated at intefcae? My boundary conditions are as follows:
=====================================
Valid fields:
volVectorField U
volScalarField p_rgh
volScalarField alpha1

patch: SENOUTLET
scalar p_rgh totalPressure
scalar alpha1 inletOutlet
vector U pressureInletOutletVelocity

wall: SENWALL
scalar p_rgh buoyantPressure
scalar alpha1 zeroGradient
vector U fixedValue

empty: SYM4
scalar p_rgh empty
scalar alpha1 empty
vector U empty

empty: SYM3
scalar p_rgh empty
scalar alpha1 empty
vector U empty

empty: SYM2
scalar p_rgh empty
scalar alpha1 empty
vector U empty

empty: SYM1
scalar p_rgh empty
scalar alpha1 empty
vector U empty

patch: TW
scalar p_rgh totalPressure
scalar alpha1 inletOutlet
vector U pressureInletOutletVelocity

wall: BW
scalar p_rgh buoyantPressure
scalar alpha1 zeroGradient
vector U fixedValue

wall: SW
scalar p_rgh buoyantPressure
scalar alpha1 zeroGradient
vector U fixedValue

======================================
Any suggestion in this regard? As suggested on forum, Now I have changed cAlpha=1 to see the effect of this on my result.
Thanks in advance.
M K Singh
=================
I have found solution to my problem why my interface was getting stagnant at certain point. After analysing my simulation, I realized that my inteface was getting stagnant exactly at zero position (y=0, vertical direction, note my middle of domian is at (0,0,0)), see picture for t=10, 50,90 s. My guess is that during presure (rho*g*h) caluculation as interface reaches at y=0 the pressure is becoming zero which is leading to stagnant inteface!! However, this needs more explaination, may be some numerical experts can provide better argument.
To solve the issue, I transformed my domain so that y=0 lies outside the domain, basically my all the domain lies in positive quadrant. This strategy has solved my problem, see attached pictures for t=10,60 s.
If someone has more input in this regard, please share.
Thanks.
M K Singh
PS: note that ladle_translation is picture where domain has been translated
Attached Images
File Type: jpg ladle_t000010.jpg (33.3 KB, 104 views)
File Type: jpg ladle_t000050.jpg (40.1 KB, 93 views)
File Type: jpg ladle_t000090.jpg (32.9 KB, 81 views)
File Type: jpg ladle_translation_t000010.jpg (26.6 KB, 82 views)
File Type: jpg ladle_translation_t000060.jpg (35.4 KB, 86 views)

Last edited by mksingh; August 3, 2012 at 07:15. Reason: clarity
mksingh is offline   Reply With Quote

Old   February 20, 2013, 06:03
Default
  #131
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
Hi interFoamers,

Someone has advanced with the implementation of interFoamSSF? I finally have some time to spend on it but i'm still confused about filtering stuff.

best

andrea
Andrea_85 is offline   Reply With Quote

Old   May 16, 2013, 04:02
Default
  #132
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
Ali Raeini has released some code now: http://www.cfd-online.com/Forums/ope...tml#post427813
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   January 7, 2015, 16:45
Default parasitic velocities in capillary flow
  #133
New Member
 
Christoph Gmelin
Join Date: Jan 2015
Posts: 1
Rep Power: 0
Christoph_G is on a distinguished road
Hi,
I'm trying to simulate a capillary two-phase flow (water/Oil), where small droplets pass a junction with a sudden expansion (see first picture). U =0.05m/s, tube diameter = 0.5mm.
My original-settings are the same as in the dam-break tutorial and I'm still using interfoam.
Everything is Ok, until the droplets reach the expansion-zone. Then large Courant numbers occur in combination with high velocities at the interface of the first droplet (see red dot at picture 2).
In my opinion the complete case is only almost stable (it's a very fragile equilibrium) an when the flow becomes a little more unstable due to its deceleration spurious currents occur.
To resolve the situation I tried the following things (everything without success):
reduce courant No.
set cAlpha to 0
use finer grids at the wall
finer grid in the expansion zone
reduce time step
more Alpha subcycles
...
Surprisingly the unchanged dam-break settings still obtain the best results. In all other cases the parasitic velocities arise much earlier.
Has anybody more Ideas how to get this problem fixed??

My last idea was to test the interfoamssf-solver (https://code.google.com/p/interfoamssf/) but I'm not very familiar with C-programming and compiling.

My second question is: How can I compile the interfoamssf source code without destroying the rest of my FOAM-installation?

Thanks,
Christoph
Attached Images
File Type: jpg 2.jpg (19.9 KB, 81 views)
File Type: jpg 5.jpg (48.3 KB, 87 views)
Christoph_G is offline   Reply With Quote

Old   October 31, 2017, 23:41
Smile
  #134
Member
 
Ali Noaman Ibrahim
Join Date: Sep 2015
Location: US_Chicago
Posts: 97
Rep Power: 11
alinuman15 is on a distinguished road
Quote:
Originally Posted by aliqasemi View Post
We have solved the problem of spurious currents in our modified version of interFoam code, you can find the details in a paper (two-phase flow at low capillary numbers / small scales) being published in JCP:

http://dx.doi.org/10.1016/j.jcp.2012.04.011


The Sharp Surafce Force part, described in the paper, is a one line code which any one can easily implement. Smoothing and filtering are also proposed in the paper.

The paper is written for Cartesian meshes, but most parts are general, and now we are using the code for unstructured meshes with very few modifications / change of discretization algorithms. Hopefully these modifications will be published soon as well.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Dear Ali:-
I have found your code on the following link :-
https://figshare.com/articles/poreFoam_package/1155422 ( for reference to others )
Can you describe how to modify the new versions of OpenFoam to avoid producing spurious currents in that kind of small scale applications based on that fabulous work! or in a nother words, how can we use it to simulate flow in 10 Microns capillary tubes ?
I highly appreciate your help.
my best
alinuman15 is offline   Reply With Quote

Old   November 2, 2017, 13:39
Default
  #135
Member
 
Ali Noaman Ibrahim
Join Date: Sep 2015
Location: US_Chicago
Posts: 97
Rep Power: 11
alinuman15 is on a distinguished road
Quote:
Originally Posted by alinuman15 View Post
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Dear Ali:-
I have found your code on the following link :-
https://figshare.com/articles/poreFoam_package/1155422 ( for reference to others )
Can you describe how to modify the new versions of OpenFoam to avoid producing spurious currents in that kind of small scale applications based on that fabulous work! or in a nother words, how can we use it to simulate flow in 10 Microns capillary tubes ?
I highly appreciate your help.
my best


I realize that I have to create new solver and use it as a new application but just try to move forward for another question regarding using that solver in the high computation server.
Appreciate your reply !
alinuman15 is offline   Reply With Quote

Old   November 29, 2017, 11:53
Default
  #136
New Member
 
Ali Q Raeini
Join Date: Feb 2010
Posts: 24
Rep Power: 16
aliqasemi is on a distinguished road
Quote:
Originally Posted by alinuman15 View Post
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Dear Ali:-
I have found your code on the following link :-
https://figshare.com/articles/poreFoam_package/1155422 ( for reference to others )
Can you describe how to modify the new versions of OpenFoam to avoid producing spurious currents in that kind of small scale applications based on that fabulous work! or in a nother words, how can we use it to simulate flow in 10 Microns capillary tubes ?
I highly appreciate your help.
my best
On a HPC server side I think its easier to only compile the poreFoam-3.1-ext, partly based on the instructions in "User-Guide for poreFlow package - direct two-phase flow simulation.pdf" file. My experience is that it can be a challenge to get openfoam compile and work on HPC machines, especially if the compilers/mpi are Intel and you have no Sudo permissions!

For simulating flow through a (10um) tube, you can either mesh it using openfoam blockMesh (which potentially produces the best quality mesh). The alternative approach is to create a 3D image of the tube (for example using Fiji/ImageJ), save it as a 8bit raw file (similar to the Berea.raw) and use AllRunImageTwoPhase script on it (it needs the poreFoam-2.4 OpenFOAM-2.4 to be compiled) to create the mesh. The flow simulations should work on the generated case, but will generate numerical stick-slip behaviour near the contact line, if the capillary number is small. My colleague has developed a more accurate surface force model to alleviate these, ... and we agreed to make it available online, once the algorithm is published, not sure when but hopefully in few months.
alinuman15 likes this.
aliqasemi is offline   Reply With Quote

Reply

Tags
capillary flows, interfoam, parasitic currents


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
how to monitor free surface elevation vs time in OF? ozgur OpenFOAM Post-Processing 56 September 14, 2015 09:11
parasitic currents Pei-Ying Hsieh Main CFD Forum 0 January 13, 2009 20:58
Parasitic currents reduction hsieh OpenFOAM Running, Solving & CFD 0 January 13, 2009 16:44
Parasitic currents reduction hsieh OpenFOAM Running, Solving & CFD 0 January 13, 2009 16:37
Modelling ocean currents of the past Earth pgm Main CFD Forum 3 March 2, 2005 09:45


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