View Issue Details

IDProjectCategoryView StatusLast Update
0002448OpenFOAMFeaturepublic2017-07-03 08:04
ReporterALU Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
PlatformGNU/LinuxOSUbuntuOS Version14.04
Summary0002448: twoLiquidMixingFoam Courant number limit
DescriptionVery small time steps are needed due to MULES. The semi-implicit variant is not available. Option for relaxing the alphaDiffusion equation and relaxing pressure is also missing.

A steady steady state version of the solver or at least allowing large time steps would be nice.
TagsNo tags attached.

Activities

henry

2017-01-31 13:34

manager   ~0007697

Can you provide a patch to add this functionality to twoLiquidMixingFoam?

ALU

2017-02-02 05:34

reporter   ~0007698

In case of mixing fluids wouldn't it be better to simply add the convection term in the alpha equation instead of using MULES, at least for the steady state approach?

henry

2017-02-02 07:29

manager   ~0007699

MULES is necessary to guarantee boundedness of the convection process.

ALU

2017-02-06 09:20

reporter   ~0007708

Don't know how to adept MULES for a steady state approach, so I added the convection term in the alpha equation and changed the pimple to simple algorithm. Boundedness can be achieved using bounded schemes, of course resulting in more numerical diffusion...

henry

2017-02-06 09:43

manager   ~0007709

Bounded schemes do not guarantee boundedness, only MULES does that. Maybe for your case there is sufficient diffusion that unboundedness is not generated and if conservation is not critical you could clip the phase-fraction.

henry

2017-02-08 10:59

manager   ~0007718

Pending contribution.

ALU

2017-03-01 13:32

reporter   ~0007837

Finally found some time to test twoLiquidMixingFoam witch IMULES and CMULES. For my case IMULES is more stable and accurate than CMULES. Also added p_rgh.relax() in pEqn.H. Moved the alpha-equations into the pimple-loop, could be better for larger time steps? I upload the patch if you are interested.

ALU

2017-03-01 13:32

reporter  

henry

2017-03-01 14:24

manager   ~0007838

Support for IMULES has been dropped because unlike CMULES it does not guarantee boundedness. Relaxing pressure is OK for steady-state simulations or in PIMPLE provided sufficient iterations are used to converge the system so it may be useful as an option. Putting the alpha equation in the PIMPLE loop would be useful to maintain accuracy for large time-steps but it may not help and in fact may hinder stability, you will need to test this on a range of cases to see which approach is preferable.

ALU

2017-03-01 16:02

reporter   ~0007839

Attached is the CMULES-patch of twoLiquidMixingFoam. The implementation is adopted from driftFluxFoam, it works but not sure if everything is done right. The alpha-equations are now outside of the pimple-loop again.

Concernig boundedness: Maybe in case of mixing fluids boundedness is not as critical as in immiscible fluids?

henry

2017-03-01 16:11

manager   ~0007840

If boundedness is not critical for your cases then you do not need MULES at all and a more traditional and efficient implicit transport with NVD/TVD scheme might be sufficient.

Did you need to put the alpha-equation outside the PIMPLE loop? What differences do you see with it inside vs outside?

ALU

2017-03-02 06:54

reporter   ~0007841

I put the alpha-equations out of the PIMPLE loop because my test-case (jet) runs 10% faster with just very slight loss of accuracy for Courant numbers up to 50 (or even higher). Also you said it my hinder stability.

I think the field of application of twoLiquidMixingFoam would be much bigger allowing the user two choose between MULES, CMULES and also IMULES or NVD/TVD scheme if boundedness is not critical. In my test-case IMULES runs smarter and allows larger times-steps than CMULES and is as accurate.

By the way, I think the naming of twoLiquidMixingFoam is a little bit misleading because I sea no reason why you should not use it with gases.

henry

2017-03-02 07:46

manager   ~0007842

Switching between ?MULES and NVD/TVD would be possible but adds complexity, we would need to know it is sufficiently useful before releasing and maintaining it. Do your cases run OK with implicit NVD/TVD?

If boundedness is important and ?MULES is needed then IMULES is not good enough. If boundedness is not important then implicit NVD/TVD is more accurate and efficient.

twoLiquidMixingFoam is named that way for historical reasons, but for mixing gases it is more logical to mix the composition as done in reactingFoam with reactions switched-off.

henry

2017-03-02 08:06

manager   ~0007843

Have you considered writing a composition mixing application rather than using twoLiquidMixingFoam? At the moment it is not clear which approach is preferable but it would be more consistent with the other solvers to mix composition rather the miscible phases.

ALU

2017-03-02 09:59

reporter   ~0007844

I will do some further testing using vanLeer scheme. I will tell you the conclusion after lunch ...

ALU

2017-03-02 13:53

reporter   ~0007845

I uploaded a plot of the distribution of alpha after the nozzle.

For Courant < 0.5 MULES, linear scheme and vanLeer scheme give matchable results.

For Courant < 50 upwind scheme does better than IMULES and CMUlES, vanLeer was not stable.
plot_alpha.png (33,436 bytes)   
plot_alpha.png (33,436 bytes)   

ALU

2017-03-02 13:55

reporter  

plot_alpha-2.png (28,677 bytes)   
plot_alpha-2.png (28,677 bytes)   

henry

2017-03-09 16:33

manager   ~0007872

How would you like to proceed with this? Are you happy to continue with upwind for which ?MULES is not needed?

ALU

2017-03-10 08:39

reporter   ~0007899

Upwind has proved its worth for the field of application I am actually working on. It is stable and bounded for high Co-Numbers (at least in my applications).

For Co-Numbers of 5 vanLeer is also working in a simple test case (not tested on complex geometry) and is more accurate than CMULES, so maybe it could be an option.

Putting alphaEqn into the PIMPLE-loop makes vanLeer diverge at the last PIMPLE iteration for CO > 1, but allows even bigger time-steps for upwind if p is relaxed.

Putting mixture.correct() before the alphaEqn is slightly better in my cases.

I think twoLiquidMixingFoam is an effective approach for incompressible, isothermal cases where no reaction is needed.

henry

2017-03-10 08:56

manager   ~0007900

Have you compared twoLiquidMixingFoam with using a liquid composition approach? Are you sure twoLiquidMixingFoam is better?

ALU

2017-03-10 10:34

reporter   ~0007903

You mean your former proposal to use reactingFoam? Not yet, I can try it next week.

henry

2017-03-10 10:56

manager   ~0007904

I am not suggesting to use reactingFoam because that is setup for compressible flow but it would be possible to write an incompressible solver for liquid composition to replace twoLiquidMixingFoam but it is not clear without trying it what the advantages and disadvantages are.

ALU

2017-03-10 11:15

reporter   ~0007905

Now I am not sure about the composition mixing approach. Is it an Euler-Euler approach?

henry

2017-03-10 11:17

manager   ~0007907

No, it would solve for the compositon mass-fractions in an analogous manner to the solving of Y in reactingFoam.

ALU

2017-03-10 11:43

reporter   ~0007908

I don't see much difference between solving the phase fraction or the mass fraction in case of incompressible fluids. YEqn.H looks very similar to alphaEqn.H in the approach I am using for now.

chris

2017-06-30 12:38

manager   ~0008310

@ALU : You stopped commenting on this issue 3 months ago. Did you resolve it?

ALU

2017-07-03 05:37

reporter   ~0008320

Yes, I used twoLiquidMixingFoam and towLiquidMixingPimpleFoam with upwind sheme. It was stable with high CO numbers and accurate enough for me (alpha distribution after a nozzle, plot_alpha-2.png in the attached files).

Issue History

Date Modified Username Field Change
2017-01-31 12:27 ALU New Issue
2017-01-31 13:29 wyldckat Category Bug => Feature
2017-01-31 13:34 henry Note Added: 0007697
2017-02-02 05:34 ALU Note Added: 0007698
2017-02-02 07:29 henry Note Added: 0007699
2017-02-06 09:20 ALU Note Added: 0007708
2017-02-06 09:43 henry Note Added: 0007709
2017-02-08 10:59 henry Assigned To => henry
2017-02-08 10:59 henry Status new => closed
2017-02-08 10:59 henry Resolution open => fixed
2017-02-08 10:59 henry Note Added: 0007718
2017-03-01 13:32 ALU Status closed => feedback
2017-03-01 13:32 ALU Resolution fixed => reopened
2017-03-01 13:32 ALU Note Added: 0007837
2017-03-01 13:32 ALU File Added: twoLiquidMixingFoam_patch.tar.gz
2017-03-01 14:24 henry Note Added: 0007838
2017-03-01 16:02 ALU File Added: twoLiquidMixingFoam_patch2.tar.gz
2017-03-01 16:02 ALU Note Added: 0007839
2017-03-01 16:02 ALU Status feedback => assigned
2017-03-01 16:11 henry Note Added: 0007840
2017-03-02 06:54 ALU Note Added: 0007841
2017-03-02 07:46 henry Note Added: 0007842
2017-03-02 08:06 henry Note Added: 0007843
2017-03-02 09:59 ALU Note Added: 0007844
2017-03-02 13:53 ALU File Added: plot_alpha.png
2017-03-02 13:53 ALU Note Added: 0007845
2017-03-02 13:55 ALU File Added: plot_alpha-2.png
2017-03-09 16:33 henry Note Added: 0007872
2017-03-10 08:39 ALU Note Added: 0007899
2017-03-10 08:56 henry Note Added: 0007900
2017-03-10 10:34 ALU Note Added: 0007903
2017-03-10 10:56 henry Note Added: 0007904
2017-03-10 11:15 ALU Note Added: 0007905
2017-03-10 11:17 henry Note Added: 0007907
2017-03-10 11:43 ALU Note Added: 0007908
2017-06-30 12:38 chris Note Added: 0008310
2017-07-03 05:37 ALU Note Added: 0008320
2017-07-03 08:04 henry Status assigned => closed
2017-07-03 08:04 henry Resolution reopened => no change required