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   May 10, 2012, 04:16
Default
  #61
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
By the way Andrea, another thing I'm not sure about is the relaxation described no page 11, 2.(e).(i.) - should we relax U and then determine phi, or determine phi and then relax it? What do you think?

- Anton
__________________
*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   May 10, 2012, 04:19
Default
  #62
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
i used adjustableRunTime.

andrea
Andrea_85 is offline   Reply With Quote

Old   May 10, 2012, 04:34
Default
  #63
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
the authors are taking about "u" (u=0.7u^(n-1)+ 0.3u^n), actually i have seen you commented out the relaxation of phi in pEqn in last version. The problem is that eq 25 is not calculated explicitly at cell centres but it is just calculated once at face centres (eq 27). So the question is which velocity has to be relaxed? the only velocity we have at the cell centres is H/A, which is the predicted velocity so maybe they are referring to that velocity

andrea
Andrea_85 is offline   Reply With Quote

Old   May 10, 2012, 07:16
Default
  #64
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
i made some other tests. I changed relaxation of phi in pEqn.H with relaxation of U=H/A, i added gradAlpha smooth in interfaceProperties.C and then i tryied to switch between mulesImplicit and mulesExplicit (actually i do not understand why you changed from explicit to implicit, the semi-implicit formulation to which they refer i think is related to the outerCorrector loop)
btw the results look better when mules explicit is used, see the attached picture.
the errors is capillary pressure are of the order of 0.02-0.04 which seems (more or less) in agreement with Fig 5 for deltax/R=0.2

best

andrea
Attached Images
File Type: jpg maxU_LL_implicit.jpg (17.4 KB, 83 views)
File Type: jpg maxU_LL_explicit.jpg (18.0 KB, 78 views)
File Type: jpg maxU_LG_mulesImpl.jpg (21.8 KB, 67 views)
File Type: jpg maxU_LG_mulesExpl.jpg (18.2 KB, 67 views)
Andrea_85 is offline   Reply With Quote

Old   May 10, 2012, 08:10
Default
  #65
Senior Member
 
Robert Castilla
Join Date: Apr 2009
Location: Spain
Posts: 110
Rep Power: 17
rcastilla is on a distinguished road
I am making some testing with capillary rise. I am experiencing problems with the sign of the argument in sqrt in the factor w. I can overcome that with a higher value than 10^-6 in eq. (17), but I guess that is not a good solution. You have commented in a previous post that a better solution should be limiting the value of alpha1. How can that be done?

With respect to the sign of the curvature, I think that it should be enough to change the sign in line 125 of interfaceProperties.C :

K_ = -fvc::div(ns);

Is it correct?

Robert
rcastilla is offline   Reply With Quote

Old   May 10, 2012, 08:21
Default
  #66
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
Hey Andrea, I switched to MULES::implicit because the authors write they use Crank-Nicholson to advect the indicator function (page 10) - that implies that they use the implicit formulation as well.

What was the effect of changing the relaxation, and changing the smoothing? Can you check them separately? I won't have time until tonight to work on the code.

- Anton

Quote:
Originally Posted by Andrea_85 View Post
i made some other tests. I changed relaxation of phi in pEqn.H with relaxation of U=H/A, i added gradAlpha smooth in interfaceProperties.C and then i tryied to switch between mulesImplicit and mulesExplicit (actually i do not understand why you changed from explicit to implicit, the semi-implicit formulation to which they refer i think is related to the outerCorrector loop)
btw the results look better when mules explicit is used, see the attached picture.
the errors is capillary pressure are of the order of 0.02-0.04 which seems (more or less) in agreement with Fig 5 for deltax/R=0.2

best

andrea
__________________
*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   May 10, 2012, 08:23
Default
  #67
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
Robert, I pushed some more changes to address the problems you mentioned - have a look at the code.

Keep us posted on the capillary rise results!

Quote:
Originally Posted by rcastilla View Post
I am making some testing with capillary rise. I am experiencing problems with the sign of the argument in sqrt in the factor w. I can overcome that with a higher value than 10^-6 in eq. (17), but I guess that is not a good solution. You have commented in a previous post that a better solution should be limiting the value of alpha1. How can that be done?

With respect to the sign of the curvature, I think that it should be enough to change the sign in line 125 of interfaceProperties.C :

K_ = -fvc::div(ns);

Is it correct?

Robert
__________________
*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   May 10, 2012, 08:38
Default
  #68
Senior Member
 
Robert Castilla
Join Date: Apr 2009
Location: Spain
Posts: 110
Rep Power: 17
rcastilla is on a distinguished road
Anton,

have you tested it? I think that where you write

max(1.0, Foam::min(alpha1_, 0.0))

it should be

min(1.0, Foam::max(alpha1_, 0.0))

if functions max and min in OF are working as I expect.

On the other hand, w should be calculated with alpha1c instead of alpha1, isn't it?

Robert
rcastilla is offline   Reply With Quote

Old   May 10, 2012, 08:46
Default
  #69
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
#Robert

I added these lines in interfaceProperties.C

volScalarField limitedAlpha1_
(
min(max(alpha1_, scalar(0)), scalar(1))
);


//factors
volScalarField w = Foam::sqrt(limitedAlpha1_*(1.0 - limitedAlpha1_) + 1e-6);
volScalarField factor = 2.0*Foam::sqrt(limitedAlpha1_*(1.0 - limitedAlpha1_)); // * pos(alpha1_-1e-6) * pos(0.9999999-alpha1_);


this should be enough to ensure a positive argument in the square root.

#Anton
i'll give a look at the two changes separately this afternoon if i have time. You can use mulesExplicit keeping crackNick as time scheme. why do you think a implicit formulation must be used when crackNick is selected? From my experiences i've never got good results using mulesImplicit.

andrea
Andrea_85 is offline   Reply With Quote

Old   May 10, 2012, 08:53
Default
  #70
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
Robert, you are right about the min/max, I messed it up! Sorry about that. If you have problems on the square-root of w use alpha1c there as well, but you should think about why you get unboundedness > 10e-6 and how much unboundedness you are willing to accept.

Andrea, if you limit alpha1_ and use it to determine w, you don't need to add 1e-6 into the square root any more ([edit] I take this back, you still have to avoid div-0[/edit]). About the time stepping - if you set MULES::explicit, you can remove the ddt(alpha1) entry from fvSchemes without the code complaining. Ergo, it doesn't matter any more what scheme you enter in the fvSchemes any more I think.
__________________
*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   May 10, 2012, 09:24
Default
  #71
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
you are right but apparently the results look better. the magnitude of spurious current is 10^-9 in liquid-liquid case when mules::explicit is used whereas is 10^-4 if implicit formulation is used. I am a bit confused.

andrea
Andrea_85 is offline   Reply With Quote

Old   May 10, 2012, 10:17
Default
  #72
Senior Member
 
Robert Castilla
Join Date: Apr 2009
Location: Spain
Posts: 110
Rep Power: 17
rcastilla is on a distinguished road
Anton,

I get negative values of alpha1, up to 1e-5. With the same case in interFoam (not SSF) I didn't have this problem. The negative values of alpha1 where under 1e-40. Can that be due to the explicit MULES solver? I will try to switch to implicit solver for testing.

Robert
rcastilla is offline   Reply With Quote

Old   May 10, 2012, 10:27
Default
  #73
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 do have the feeling that there is less unboundedness using MULES::implicit. See attachments for my results using MULES::implicit - it's very good for the liquid-liquid system, and less good for liquid-gas.
Attached Images
File Type: png static.png (4.9 KB, 76 views)
File Type: png staticLL.png (4.3 KB, 79 views)
__________________
*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   May 10, 2012, 11:39
Default
  #74
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
I can't get the same results with implicit mules and i dont know why. Did you change something in fvSchemes or fvSolution?. Can you post again the static test case. my plots look really different from yours in case of mules::implicit.

andrea
Andrea_85 is offline   Reply With Quote

Old   May 10, 2012, 14:30
Default
  #75
Senior Member
 
Robert Castilla
Join Date: Apr 2009
Location: Spain
Posts: 110
Rep Power: 17
rcastilla is on a distinguished road
Actually, I realized that it was yet with MULES::implicit. interFoam uses MULES::explicit. I have switched, and, though the simulation is very slow, it seems to behave better (at least the negative values of alpha1 are of the order of 1e-40.

Robert
rcastilla is offline   Reply With Quote

Old   May 11, 2012, 05:57
Default
  #76
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
Andrea, I pushed the testcase to the repository.

Robert, I didn't quite understand which one you think works better now - implicit or explicit?
__________________
*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   May 11, 2012, 07:41
Default
  #77
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
i lowered the tolerance in p, pFinal, pcFinal, Ufinal and alpha1 to match your fvSolution and i got really nice results, even in the gas-liquid case (why we get different results in this case is a mystery, maybe you are using different tolerance in two case). I used 1e-6 s for the time-step, 2 piso and 3 outCorr and mules::implicit. I also compared the case with 3 Piso and 4 outCorr for liquid-liquid system and results are the same but the sim takes much more time.

Then i compared the case in which it is performed a smoothig on gradAlpha (green curve in the first plot) with the case in which is not (yellow and blue curve in the first plot). they look both nice but different, I do not know exactly how to interpret them

best
andrea
Attached Images
File Type: jpg maxU_LL_.jpg (31.7 KB, 73 views)
File Type: jpg maxU_GL.jpg (21.7 KB, 53 views)
Andrea_85 is offline   Reply With Quote

Old   May 11, 2012, 07:56
Default
  #78
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
Andrea, I'd be thankful if you could use an unmodified build of interFoamSSF and the test case (it takes about 30 min on my system to run) and check your results, and then try to isolate which of your modifications leads to a change of the convergence...

I'm using exactly the same settings in the liquid-gas and liquid-liquid cases, only the transport properties change.

- Anton

[edit] It would also be a good idea if you push your version of the code to a clone repository on google code so we both can compare [/edit]

[edit no 2] I think I narrowed it down: Can you cross-check constant/transportProperties? A liquid droplet immersed in a gas phase gives a different convergence than a gas bubble in a liquid phase!
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.

Last edited by akidess; May 11, 2012 at 09:10. Reason: Add note about google code
akidess is offline   Reply With Quote

Old   May 11, 2012, 09:08
Default
  #79
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
The two version we are using are the same, the only changes are PIMPLE controls. The test case is the same, the only difference at this point is the time step, it takes 5min wiht 1e-6 (I just checked the difference using 2 PISO and 3 outCorr as it is described in the paper, pag 11, but the results are the same so we can exclude it). I think i undrestood why we get different results in the liquid-gas case: you are simulating a liquid droplet immersed in a gas while, as in the paper, i'm simulating a gas droplet immersed in a liquid. check your transport properties and your setFieldDict. the properties are inverted.
btw attached you can find my results for liquid droplet immersed in a gas (unmodified test case) and they are equal to what you got in #73

best

andrea
Attached Images
File Type: jpg maxU_LG.jpg (21.2 KB, 53 views)
Andrea_85 is offline   Reply With Quote

Old   May 11, 2012, 09:30
Default
  #80
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
You are right about the ordering of the phases. Do you think it's a concern that the liquid droplet performs worse?
__________________
*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

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 12:37.