# Simulation issue of multi-phase analysis

Hello,

I got a simulation problem with my project.
In the past, I successfully simulated my design with incompressible analysis for 1 hr. So, I moved on with multi-phase.
I try to simulate with multi-phase analysis, but it had a problem with simulation time. Now, the simulation time is taking 435 mins for 4 %. I can’t find out an exact answer what was wrong? My design, my set up or anything.

Hi @nctrung1407!

Sorry for the small delay! Will have a look at that later on. @vgon_alves & @Get_Barried, please have a quick look in the meantime if you can and see if you can identify some typical setup issues for his simulation, thanks

Cheers!

Jousef

1 Like

Hi @nctrung1407,

The reason as to why the incompressible simulation is so fast is because it is a steady state simulation (SS). SS simulations are always orders of magnitude computationally cheaper to run compared to the multi-phase simulation which is currently set to transient.

SS simulations do not require the actual progression of “time” per say. They just solve for the solution that is inherently within the domain (aka the meshed geometry) hence its a matter of how many mathematical iterations to get to the final solution that is most accurate. There is no need to resolve many solutions to get to the final one for SS simulations in a sense.

Compare this to transient simulations where time does exist and the solution has to progressively be solved through per timestep for the total time, you can see why this is so much more inherently time consuming as the solution always changes every timestep and has to be constantly solved again and again till the end time is reached. Considering that also that information cannot travel faster than the flow per say, you have to maintain solution continuity by ensuring as such. This brings in the consideration of courant number and again contributes to the further computational costs of transient simulations.\

So for starters, there is really nothing wrong with your simulation. It is the nature of transient simulations to take this long and to be costly. For context, a 2D simulation with 2mil nodes (similar to yours) transient laminar one that I did takes about 8-10 hours to complete for a end time of 0.25s and a maximum courant of 0.7.

That being said, you need to adjust your simulation control. Currently your end time is set to 0.5s which can be further optimized as you dont want to run the simulation for longer that it needs to as it is a waste of computational resources. You need to roughly calculate how long it takes for the flow at the furthest end to reach the end of the pipe. For example if your flow travels at 1m/s for a pipe that is 1m long then your end time should be 1s. Though you will probably need to add some factor of safety into it and give say 10% more the solution to reach a pseudo “steady-state” where the solution does not deviate too much and can give you reliable results to extract out.

You can also set the Maximal CO to 1 and that should help in reducing your simulation time significantly. Your mesh has no errors and setup looks alright so do try it out and let us know. Oh and last thing, you might want to set some sort of result control to monitor the results within the geometry and maybe at the outlet so that you can tell if the simulation has reached this pseudo “steady-state”. The convergence plot is likely insufficient to give you a good tell.

Cheers.

Regards,
Barry

1 Like

Hello @Get_barried,
Thank you so much for your support and some advice from you. I appreciate it.
According you answer, how can I set up some sort of result control to monitor to confirm “steady-state” or “none steady-state”.
Thanks

Best regards,
Trung

Hi @nctrung1407,

You can do so under Result Control. Explore it a little and see what kind of results you can or want to monitor. Its probably going be something simple like pressure or something.

Cheers.

Regards,
Barry

Hi Trung & Barry!

Did you mean the switch between steady-state and transient? That can be changed here:

Best,

Jousef

Hello @Get-Barried,

I tried to modify simulation control with end time from 0.5 s to 1.5 s, and Max CO from 0.5 to 1.
However, it perhaps inefficiency. Please see two images (before and after changed)

Before (4% - ~14.7 hrs)

After (Only 1% - 17.7 hrs)

I canceled two simulations. Do I need to continue this simulation for more and more time? Or what should I do?

Best regards,
Trung

Hi Trung!

We are having a look at this and let you know what adaptions can be made in order to have a more efficient and stable simulation.

Best,

Jousef

1 Like

Hi @nctrung1407,

Is your inlet speed supposed to be that slow? Currently, its set to 1.6E-7 and if we take the total distance of about 0.05m and divide that by the inlet speed, you’re looking at simulation time of over 300,000 seconds which is much too long. At this rate, we will probably have to make further assumptions if not use a steady-state multiphase solver.

@jousefm, is there a documentation containing the solvers used for multiphase like the one for compressible flow like the one shown below?

Cheers.

Regards,
Barry

1 Like

Hi guys!

Indeed your velocity is way too low at the moment which causes a ton of timesteps - I was able to go up to 26% of the simulation but cancelled it as it will be just a waste of core hours. Once you find optimal values for your inlet(s) we can make a test run.

Edit: We have the following solvers for multiphase:

• interFoam
• interDyMFoam (for solidbodymotions)
• LTSInterFoam (local-timestepping)

Best,

Jousef

1 Like

Hi @jousefm,

Because I do NOT know how much is optimize velocity of two inlets for my design, so I want to find out by using CFD simulation.
Which way is the best solution to discovery optimized velocity? Do you have any suggest?
Thank you so much.

Best,
Trung

Hi Trung!

Sure, got it. So the input parameters are your velocities and you want to find the optimal values, but optimal for what? Are you looking for a certain pressure or distribution? The output variable is somehow not clear to me. Maybe @Get_Barried has an idea on that one.

Cheers,

Jousef

1 Like

My input value is velocity, and I want to find the optimized parameters to simulate successfully like below video.

Thanks,
Trung

Hi @nctrung1407,

Visual representations like this are not good parameters to judge what your simulation end goal is. What you need to define is the phenomena you are trying to replicate or observe in terms of actual numbers. Sure there are simulations out there where visually replicating flow behavior is the only possible result such as in a vortex ring collision replication. But in this case, a simple constrained pipe flow is not one of those scenarios.

I would recommend reading through literature on multiphase pipe flow and deduce some judging parameter from there. Otherwise, if you really want to just see the flow behave like that then you just have to guess the inlet velocity and tune it till you get somewhat close to what you want. For starters though, that super low inlet velocity is not workable. Try setting it at 1m/s at the inlets and see what happens. From the basic calculations your simulation end time should now be 0.05s. You can fine tune it from there.

Cheers.

Regards,
Barry

1 Like

Hi @Get_Barried,

I will read some multi-phase pipe flow books, and try to deal with from high velocity to low velocity to see the phenomena. After that, I will confirm the optimal value.

Best,
Trung

Hi @Get_Barried,

Following your recommendation, I try to set 1m/s for inlet velocities and end time as 0.05.
However, it not effective. Was I wrong something?

Thanks.
Trung

Hi @nctrung1407,

The simulation is taking a long time because your flow velocity is too high. Too high a flow velocity requires smaller and smaller time steps to ensure that the Co remains below 1. Thats where the fine tuning of the inlet flow comes into play which I’ve previously mentioned. You should decrease your flow speed by an order of magnitude (0.1m/s) and keep going till you get a reasonable run time where you can check how flow behaves before further fine tuning of the inlet value.

Cheers.

Regards,
Barry