Divergence problem related to interMixingFoam
4 Attachment(s)
Hi Foamers,
I am doing a simulation related to 3 incompressible fluids (ethanol, water and air), two of them are misible, from the Openfoam User Guide, I used interMixingFoam, my concentration is on the mixing process of water and ethanol. The physical process is firstly put the ethanol and water in a cup that have a inlet hole in the bottom, and then pump air into the cup from the bottom to help the mixing process (the geometry of the cup is shown in attatched pictures, the second picture shows that the ethanol is initially at the center of the water), the air is pumped into the cup within a specified time interval (which means the pressure at inlet is a time-dependent variable, and the inlet velocity should be calculated via this inlet pressure). At the first time, I create the cup geometry by blockMeshDict and setup the varying pressure by uniformTotalPressure (I'm not familiar about this boundary condition, before this I have attempt timeVaryingTotalPressure, timeVaryingUniformFixedValue, timeVaryingMappedFixedValue and uniformFixedValue but all failed, the Openfoam returns an error indicate that there is no such a BC for the former two, I used Openfoam 2.3.1, for the latter two, I don't know how to use them since I didn't found a clear tutorial), after I start the simulation, it diverges at the begining and I don't know how to fix this problem. After that, I tried to change the time-dependent boundary condition since I dont't familiar about it, I modified the inlet pressure to a fixed value and restart the simulation, but the diverge problem still exist. I have tried refine the mesh, decrease (or increase) the Courant number, decrease the deltaT value but all failed. Then I have changed the geometry of the cup to a simple cylinder, and the simulation converges in the first 0.06s but diverges after that (under the fixed inlet pressure BC). I have attatched the zip files of my simulation code (include varying pressure and fixed pressure) , could anyone help me to check my case file? I don't where is the problem, and if possible, could you help me to check if my time-dependent pressure BC is correct? Any suggestion will be appreaciated! Best, weicent |
the below is the message come from terminal window, as you can see, the courant number is extremly large, which is not normal.
Courant Number mean: 3250.96 max: 2.49028e+08 Interface Courant Number mean: 0 max: 0 deltaT = 2.2309e-12 --> FOAM Warning : From function Time::operator++() in file db/Time/Time.C at line 1055 Increased the timePrecision from 6 to 7 to distinguish between timeNames at time 0.00111111 Time = 0.001111111 --> FOAM Warning : From function Time::operator++() in file db/Time/Time.C at line 1055 Increased the timePrecision from 7 to 8 to distinguish between timeNames at time 0.00111111 diagonal: Solving for alpha.air, Initial residual = 0, Final residual = 0, No Iterations 0 smoothSolver: Solving for alpha.other, Initial residual = 1.05882e-06, Final residual = 8.58729e-18, No Iterations 1 Air phase volume fraction = 0.60692 Min(alpha1) = 0 Max(alpha1) = 1.1154 Liquid phase volume fraction = 0.605912 Min(alpha2) = 0 Max(alpha2) = 1.1154 |
the below is the message come from terminal window, as you can see, the courant number is extremly large, which is not normal.
Courant Number mean: 3250.96 max: 2.49028e+08 Interface Courant Number mean: 0 max: 0 deltaT = 2.2309e-12 --> FOAM Warning : From function Time::operator++() in file db/Time/Time.C at line 1055 Increased the timePrecision from 6 to 7 to distinguish between timeNames at time 0.00111111 Time = 0.001111111 --> FOAM Warning : From function Time::operator++() in file db/Time/Time.C at line 1055 Increased the timePrecision from 7 to 8 to distinguish between timeNames at time 0.00111111 diagonal: Solving for alpha.air, Initial residual = 0, Final residual = 0, No Iterations 0 smoothSolver: Solving for alpha.other, Initial residual = 1.05882e-06, Final residual = 8.58729e-18, No Iterations 1 Air phase volume fraction = 0.60692 Min(alpha1) = 0 Max(alpha1) = 1.1154 Liquid phase volume fraction = 0.605912 Min(alpha2) = 0 Max(alpha2) = 1.1154 |
Try this.
For /U BC: walls { type fixedValue; value uniform (0 0 0); } outlet { type pressureInletOutletVelocity; value uniform (0 0 0); } inlet { type fixedValue; value uniform (0 0 1); } For /p BC: walls { type fixedFluxPressure; } inlet { type zeroGradient; } outlet { type totalPressure; p0 uniform 0; U U; phi phi; rho rho; psi none; gamma 1; value uniform 0; } Other is good. Hope it works with this combination ;) |
Hi dzordz;
Thank you very much for you reply! I have tried your code, but the problem still exist, I put it below, its actually still diverges: Courant Number mean: 0.000236288 max: 7.53633 Interface Courant Number mean: 0 max: 0 deltaT = 1.68055e-12 --> FOAM Warning : From function Time::operator++() in file db/Time/Time.C at line 1055 Increased the timePrecision from 7 to 8 to distinguish between timeNames at time 4.56634e-05 Time = 4.5663439e-05 diagonal: Solving for alpha.air, Initial residual = 0, Final residual = 0, No Iterations 0 smoothSolver: Solving for alpha.other, Initial residual = 4.12149e-10, Final residual = 4.12149e-10, No Iterations 0 Air phase volume fraction = 0.392911 Min(alpha1) = 0 Max(alpha1) = 1 Liquid phase volume fraction = 0.60608 Min(alpha2) = -5.37996e-73 Max(alpha2) = 1.00064 --> FOAM Warning : From function Time::operator++() in file db/Time/Time.C at line 1055 Increased the timePrecision from 8 to 9 to distinguish between timeNames at time 4.56634e-05 diagonal: Solving for alpha.air, Initial residual = 0, Final residual = 0, No Iterations 0 smoothSolver: Solving for alpha.other, Initial residual = 4.12149e-10, Final residual = 4.12149e-10, No Iterations 0 Air phase volume fraction = 0.392911 Min(alpha1) = 0 Max(alpha1) = 1 Liquid phase volume fraction = 0.60608 Min(alpha2) = -5.37996e-73 Max(alpha2) = 1.00064 DICPCG: Solving for p_rgh, Initial residual = 0.00332591, Final residual = 0.00015166, No Iterations 9 DICPCG: Solving for p_rgh, Initial residual = 0.00450806, Final residual = 0.000213074, No Iterations 7 DICPCG: Solving for p_rgh, Initial residual = 0.00645848, Final residual = 0.000316934, No Iterations 7 time step continuity errors : sum local = 4.90275e-07, global = 4.19724e-14, cumulative = -4.96021e-05 DICPCG: Solving for p_rgh, Initial residual = 0.00844886, Final residual = 0.000409655, No Iterations 7 DICPCG: Solving for p_rgh, Initial residual = 0.0127241, Final residual = 0.000561724, No Iterations 8 DICPCG: Solving for p_rgh, Initial residual = 0.0162193, Final residual = 0.000758191, No Iterations 9 time step continuity errors : sum local = 1.17456e-06, global = -5.09239e-15, cumulative = -4.96021e-05 DICPCG: Solving for p_rgh, Initial residual = 0.0242594, Final residual = 0.00102831, No Iterations 11 DICPCG: Solving for p_rgh, Initial residual = 0.0363386, Final residual = 0.00165169, No Iterations 11 DICPCG: Solving for p_rgh, Initial residual = 0.0423467, Final residual = 9.83501e-08, No Iterations 166 time step continuity errors : sum local = 1.48924e-10, global = 1.54726e-11, cumulative = -4.96021e-05 time step continuity errors : sum local = 1.48924e-10, global = 1.54726e-11, cumulative = -4.96021e-05 ExecutionTime = 17.87 s ClockTime = 17 s thanks for your kind help again; weicent |
1 Attachment(s)
I actually found some problems in setFieldsDict, before using the interMixingFoam, I have been working with interFoam, which is a two phase solver, so this is the first time I tried to manage three fluids in setFieldsDict by VOF method, I misunderstand something when modify this dictionary, now I have changed it, but the diverge problem still exist, I put the new setFieldsDict here so that someone can check my case to see where is the diverge problem.
|
Quote:
|
Quote:
thanks for your help, I have made some modify in alpha.air, alpha.water and alpha.other, and also in geometry. I have delete the arc edges in blockMeshDict now, since the curved geometry make the mesh quality is not good, I'm planning to establish this curved geometry later on, but before that, I need to check if the modified case can running well, actually, it seems converges untill 0.43, and the simulation still running I'm waiting to see if it can finally yield a stable result. below is the new alpha.xx documents I used: PHP Code:
PHP Code:
PHP Code:
|
3 Attachment(s)
the cylinder geometry and mesh should be created like the first and second picture, while my geometry is shown in the third picture, which i think probably a mistake which lead to simulation divergence.
I will try to modify the new blockMeshDict later and update the outcomes. |
1 Attachment(s)
Quote:
|
What output do you get with checkMesh? There might be some skew faces or big non-orthogonal cells that are messing up your simulation.
|
Quote:
below is my checkMesh output, thanks for help: PHP Code:
|
Quote:
After last time I modify the alpha.xxx and blockMesh, the simulation seems converges, while after 0.82s, it still diverge. Then I made some modify again and combined your P/U code and finally it worked, the simulation now looks very good and paraview shows a satisfied result, thank you my friend! For summary, below is what I modified from last time: 1. I have changed the inletValue and value for alpha.air and alhpa.other for alpha.air, the updated code is: inlet { type inletOutlet; inletValue uniform 0.5; value uniform 0.5; } for alpha.other, the updated code is: inlet { type inletOutlet; inletValue uniform 0.5; value uniform 0; } 2. I have replace the P/U boundary condition with your code. 3. I have disable the arc edges 4. I set the inlet velocity as 'uniform (0 0.5 0)', which is 0.5m/s But I actually don't understand what does 'value' specified? In my opinion, in alpha.xxx file, the 'inletValue' command specify the volume phase fraction at inlet, 1 represents inlet is full of that phase, 0 means there is no that phase at inlet (I'm not sure if I am right), so what on earth the 'value'command specify? Best; weicent |
Quote:
After the simulation diverges, I open the controlDict and change the start time from 0s to 1.75s (also change the 'startFrom' from 'latestTime' to 'startTime') and then restart the simulation, it seems the simulation running again. I will update if there is any other problem occurs. Below is some of the diverge messege in terminal window at 1.75s, does anyone know what lead to the below error? PHP Code:
Best; Weicent |
The simulation finished, I set the endTime equal to 2.5s, the diverge message did not appear again, and the result seems fine, while I still don't know why the diverge problem appears at 1.75s.
|
I'm glad that you have been able to solve it. For why divergence happens I also have no clue :)
|
Quote:
|
Specification of 'value' keyword
Quote:
|
All times are GMT -4. The time now is 10:06. |