# parasitic currents

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

 May 10, 2012, 03:16 #61 Senior Member     Anton Kidess Join Date: May 2009 Location: Germany Posts: 1,280 Rep Power: 23 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.

 May 10, 2012, 03:19 #62 Senior Member   Andrea Ferrari Join Date: Dec 2010 Posts: 314 Rep Power: 10 i used adjustableRunTime. andrea

 May 10, 2012, 03:34 #63 Senior Member   Andrea Ferrari Join Date: Dec 2010 Posts: 314 Rep Power: 10 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

May 10, 2012, 06:16
#64
Senior Member

Andrea Ferrari
Join Date: Dec 2010
Posts: 314
Rep Power: 10
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
 maxU_LL_implicit.jpg (17.4 KB, 73 views) maxU_LL_explicit.jpg (18.0 KB, 68 views) maxU_LG_mulesImpl.jpg (21.8 KB, 60 views) maxU_LG_mulesExpl.jpg (18.2 KB, 60 views)

 May 10, 2012, 07:10 #65 Senior Member   Robert Castilla Join Date: Apr 2009 Location: Spain Posts: 100 Rep Power: 10 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

May 10, 2012, 07:21
#66
Senior Member

Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,280
Rep Power: 23
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 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
__________________
*Spend as much time formulating your questions as you expect people to spend on their answer.

May 10, 2012, 07:23
#67
Senior Member

Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,280
Rep Power: 23
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 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
__________________
*Spend as much time formulating your questions as you expect people to spend on their answer.

 May 10, 2012, 07:38 #68 Senior Member   Robert Castilla Join Date: Apr 2009 Location: Spain Posts: 100 Rep Power: 10 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

 May 10, 2012, 07:46 #69 Senior Member   Andrea Ferrari Join Date: Dec 2010 Posts: 314 Rep Power: 10 #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

 May 10, 2012, 07:53 #70 Senior Member     Anton Kidess Join Date: May 2009 Location: Germany Posts: 1,280 Rep Power: 23 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 ( 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.

 May 10, 2012, 08:24 #71 Senior Member   Andrea Ferrari Join Date: Dec 2010 Posts: 314 Rep Power: 10 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

 May 10, 2012, 09:17 #72 Senior Member   Robert Castilla Join Date: Apr 2009 Location: Spain Posts: 100 Rep Power: 10 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

May 10, 2012, 09:27
#73
Senior Member

Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,280
Rep Power: 23
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
 static.png (4.9 KB, 67 views) staticLL.png (4.3 KB, 70 views)
__________________
*Spend as much time formulating your questions as you expect people to spend on their answer.

 May 10, 2012, 10:39 #74 Senior Member   Andrea Ferrari Join Date: Dec 2010 Posts: 314 Rep Power: 10 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

 May 10, 2012, 13:30 #75 Senior Member   Robert Castilla Join Date: Apr 2009 Location: Spain Posts: 100 Rep Power: 10 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

 May 11, 2012, 04:57 #76 Senior Member     Anton Kidess Join Date: May 2009 Location: Germany Posts: 1,280 Rep Power: 23 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.

May 11, 2012, 06:41
#77
Senior Member

Andrea Ferrari
Join Date: Dec 2010
Posts: 314
Rep Power: 10
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
 maxU_LL_.jpg (31.7 KB, 66 views) maxU_GL.jpg (21.7 KB, 49 views)

 May 11, 2012, 06:56 #78 Senior Member     Anton Kidess Join Date: May 2009 Location: Germany Posts: 1,280 Rep Power: 23 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  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 08:10. Reason: Add note about google code

May 11, 2012, 08:08
#79
Senior Member

Andrea Ferrari
Join Date: Dec 2010
Posts: 314
Rep Power: 10
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
 maxU_LG.jpg (21.2 KB, 45 views)

 May 11, 2012, 08:30 #80 Senior Member     Anton Kidess Join Date: May 2009 Location: Germany Posts: 1,280 Rep Power: 23 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.

 Tags capillary flows, interfoam, parasitic currents

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post ozgur OpenFOAM Post-Processing 56 September 14, 2015 08:11 Pei-Ying Hsieh Main CFD Forum 0 January 13, 2009 20:58 hsieh OpenFOAM Running, Solving & CFD 0 January 13, 2009 16:44 hsieh OpenFOAM Running, Solving & CFD 0 January 13, 2009 16:37 pgm Main CFD Forum 3 March 2, 2005 09:45

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