|
[Sponsors] |
Transient compressible SIMPLE solver - some help |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 6, 2018, 15:29 |
Transient compressible SIMPLE solver - some help
|
#1 | |
Member
Join Date: Jan 2018
Posts: 31
Rep Power: 8 |
Hello all,
Thanks to your help in this thread Advice regarding algorithm for solution of discretised equations in compressible flow I have managed to make a steady state solver for 1D flow based on a compressible SIMPLE algorithm as described by LuckyTran. Now I am struggling to extend the steady state model to a transient model. Following this advice: Quote:
- Why do we solve for density twice in one iteration (continuity eq. and eq. of state)? Isn't this a bit unusual? - if continuity is supposed to be satisfied after the pressure correction equation, isn't it problematic to do a density correction afterwards as this changes the mass fluxes? - Should the mass fluxes be recalculated after the pressure correction eq. (when cont. is satisfied) or at the end of the iteration? I would in general like to hear any opinions on this matter. I noticed in the book by Ferziger and Peric that the EOS is used to calculate pressure but I couldn't figure out their algorithm. Any thoughts on that algorithm would be appreciated aswell! |
||
August 6, 2018, 16:58 |
|
#2 | ||
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,747
Rep Power: 66 |
Quote:
I would just add that SIMPLE is a predictor-corrector method. Saying that you "solve" anything has a different meaning. What you are doing is calculating a prediction and then applying correctors. It also means you can't fully satisfy all the governing equations in 1 sweep. Remember you are implicit in time. You need a value for density before you can calculate anything else. Density appears in the continuity equation and momentum equation. You cannot solve the momentum equation for velocity unless you already have an initial guess for density. How you get this initial guess can be done a few ways. Quote:
If you don't update the density, then you already know that you do not satisfy continuity. Updating density means you no longer satisfy continuity that is true. All fluxes need to be recalculated, and that's why you normally do more than 1 iteration of SIMPLE. The inconsistencies you have between density, pressure, & velocity (hopefully) get corrected with many iterations (just like in a steady algorithm). You have a choice. You can correct them immediately or you can take them into another iteration. There are some exceptions, i.e. when you take really small timesteps so that variables do not change drastically and coupling between equations is limited. In conclusion I agree it's still debatable whether you pull density out of the continuity equation at the start. |
|||
August 7, 2018, 04:01 |
|
#3 | |||
Member
Join Date: Jan 2018
Posts: 31
Rep Power: 8 |
Quote:
But isn't this the condition you have to keep at the end of each iteration in a SIMPLE algorithm? Quote:
Would it be possible to just use the value from the previous time step/iteration and then use only the EOS to calculate density? In essence this would mean the algorithm would be the same as in the steady state case (momentum -> energy -> EOS solved for density -> press. cor). Quote:
What would be the alternatives? |
||||
August 7, 2018, 04:32 |
|
#4 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,849
Rep Power: 73 |
Maybe the issue can be seen by looking at the continuity equation integrated in time:
rho(t1,x) =rho(t0,x) - Int [t0,t1] div (rho v) dt This exact equation highlights that the condition at t0 is not sufficient to determine the density at t1 as you should know as both density and velocity change in the time interval (t0,t1). This change is fully coupled to the other variables. The numerical integration can have some tricks. For example, using explicit methods, the RHS is computed without having information on the state at t1 and there is no apparent reason to perform a correction on the computed density. However, small numerical errors in the density can be strongly amplified (for example at low Mach) and a correction is sometimes applied. |
|
August 7, 2018, 04:36 |
|
#5 | ||
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,285
Rep Power: 34 |
Quote:
When your pressure solver finishes you get new pressure and thus you get new density. But as soon as you called energy solver, now you shall have new density due to temperature change. Now it is very important to update density at this point but as soon as you do, your continuity no longer satisfies. Quote:
Solver is very very sensitive to density, pressure and temperature trio here. You might solve some cases by the approach you said but anything difficult and expect to run into trouble. For the reasons mentioned, in my solver Wildkatze there is a special version of segregated solver available for combustion problems. In this we solve 1. Momentum 2. Continuity (mainly due to velocity change) 3. Energy 4. Again continuity (from the system set up in step 3), I just update the source term and solve the system again, which got disturbed due to energy. Now it is consistent for pressure, density and temperature. The solver shows very good robustness so far. |
|||
August 21, 2018, 07:26 |
|
#6 |
Member
Join Date: Jan 2018
Posts: 31
Rep Power: 8 |
Arjun, if I may ask, when is the equation of state used in your solver?
|
|
August 27, 2018, 10:16 |
|
#7 |
Member
Join Date: Jan 2018
Posts: 31
Rep Power: 8 |
Unfortunately I still haven't been able to get a transient solution going. I would be grateful if I could get any opinions on it because it seems that I am not considering something correctly. This is the current algorithm that is causing me problems.
-> Load all variables from a steady-state solution (p,h0,h,rho,u) - let's call them PHI. start time loop -> State that PHI_0=PHI (variables at old time level are those currently in the memory) -> State that PHI*=PHI (first guess for inner iteration is also equal to last value in memory) start inner loop -> Again state that PHI*=PHI (this line is skipped in first iteration) -> Obtain density from the continuity equation using old values of velocity u* (continuity equation is discretized with central differencing scheme on regular mesh (u is stored on cell faces - staggered) and implicit in time) -> Obtain velocity from momentum equation based on new density (for the transient term), old pressure, old mass fluxes (for convective terms) and old friction factor. Momentum eq. is discretized with 1st. order upwind on staggered mesh and implicit in time. -> Obtain total enthalpy from energy equation based on new density (for transient term), old mass fluxes (for convective term). It's discretized with 1st. order upwind on regular mesh and is implicit in time. -> new enthalpies are determined based on new total enthalpy and new velocity (h0=h+0.5*u^2) -> Obtain pressure and velocity corrections by inserting momentum eq. into continuity eq. (SIMPLE). I only do a pressure correction p' and not a density correction (rho') because Ma is always < 0,3. It has done the trick in steady case but I will probably implement rho' aswell. -> compute mass fluxes from new density and new velocity -> update density based on last h and p with the EOS end inner loop t=t+dt end time loop BC's: Mass flux m'' and total enthalpy h0 at inlet face and pressure at the last node (not face) so that it coincides with the last face of the staggered grid. I extrapolate pressure to inlet/outlet. At the inlet p,h0 and m'' give sufficient info to determine all other variables, at the outlet I also extrapolate h0 and determine m'' from the continuity eq. The boundary values are updated everytime p,h0 or m'' change. I notice that the problem begins after the pressure correction, because it is too large for a case where no change should be present anymore. The velocity correction then affects mass flux reconstruction and everything goes down from there. Beside not having a density correction in the pressure correction eq. does anyone see anything else I could be missing (and that could effect the magnitude of the pressure correction)? |
|
September 24, 2018, 02:49 |
|
#8 | |
Member
Join Date: Jan 2018
Posts: 31
Rep Power: 8 |
Quote:
And in regard to that, I read an article by F. Moukalled where he states that the compressible SIMPLE algorithm is as follows: -> solve momentum with old pressure and density -> solve pressure correction eq. and update u,p,rho -> solve energy equation -> update density Would you consider this a valid procedure? |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SIMPLE with coupled solver | tladd | OpenFOAM Running, Solving & CFD | 1 | August 17, 2015 12:17 |
Fluent Adjoint Solver for compressible flow | b.shuvayan | FLUENT | 2 | January 30, 2015 08:27 |
compressible solver for engine simulations | Peter_600 | OpenFOAM | 6 | June 9, 2011 14:40 |
TUI Transient solver to Steady solver | mbell10 | FLUENT | 1 | February 2, 2011 09:53 |
compressible SIMPLE method | fakor | Main CFD Forum | 1 | August 30, 2010 12:21 |