|
[Sponsors] |
How to freeze additional variables fields for a number of solver iterations? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 2, 2018, 08:07 |
How to freeze additional variables fields for a number of solver iterations?
|
#1 |
Senior Member
Join Date: Feb 2011
Posts: 496
Rep Power: 18 |
Hello guys!
As you all know CFX allows users to create additional variables and solve transport or algebraic equations for them. It does it on every single iteration just after solution of hydrodynamic system. I want to force solver to recalculate additional variables fields on every n-th iteration, i.e. I want to freeze their fields for a number of iterations, then recalculate and freeze again and so forth. The problem is simple - I can't find a way to do so Maybe someone knows solution or has an idea? |
|
March 2, 2018, 08:32 |
|
#2 |
Senior Member
Join Date: Jun 2009
Posts: 1,880
Rep Power: 33 |
If you are willing to stop/start the software every n-th iteration, you can use the expert parameter "solve scalar = t/f" between iterations.
May I ask why you want to freeze the solution of the scalars? Are you looking to speed up the calculation, or to converge a highly non-linear interaction? |
|
March 2, 2018, 09:10 |
|
#3 | |
Senior Member
Join Date: Feb 2011
Posts: 496
Rep Power: 18 |
Quote:
The second. |
||
March 2, 2018, 10:00 |
|
#4 |
Senior Member
Join Date: Jun 2009
Posts: 1,880
Rep Power: 33 |
Would you mind showing some of the non-linearities in your problems ?
Is the case steady-state? Perhaps under-relaxing the scalar changes, their influence propagates slower and you may obtain better robustness. |
|
March 2, 2018, 10:42 |
|
#5 | |
Senior Member
Join Date: Feb 2011
Posts: 496
Rep Power: 18 |
Quote:
Anyway I would like to try technique that I metioned if it feasible. Last edited by Antanas; March 3, 2018 at 10:37. |
||
March 2, 2018, 20:16 |
|
#6 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
The more normal approach to deal with this is to reduce the under-relaxation parameter on the offending equation. But your last comment suggests it could be more on the fluid side than your additional variables.
I trust you have done all the normal things: smaller time steps, double precision numerics, better initial conditions, improved mesh quality
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
|
March 3, 2018, 10:35 |
|
#7 | |
Senior Member
Join Date: Feb 2011
Posts: 496
Rep Power: 18 |
Quote:
You're absolutely right. Last edited by Antanas; March 7, 2018 at 17:27. |
||
March 7, 2018, 17:27 |
|
#8 |
Senior Member
Join Date: Feb 2011
Posts: 496
Rep Power: 18 |
UPD. Ok, guys. URF did nothing for me. The problematic region is near the wall in a place where electromagnetic boundary conditions change from prescribed constant voltage to insulation. I think that in reality there is something like an electrical breakdown there. Therefore simulation gives some crazy values of currend density there and as a consequence of Lorenz force and Joule heating. Seems like CFX can't handle it. So I introduced limitation on this two quantities by truncating their values which 10 (number without justification) times higher than their volume averages in domain. Solution converged. Also solution converges without this limitations if I use Zero Equation turbulance model instead of k-e or SST.
|
|
March 7, 2018, 17:35 |
|
#9 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
It is not uncommon to have to put artificial limiters in when you have very sharply resolved physics. A good thing to do to check you are not affecting accuracy is to do a sensitivity analysis on the limiting value. Check that a limiter of 10 and 100 makes no difference to the simulation result and you can have some confidence that your limiter is not artificially affecting the results.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
|
March 8, 2018, 05:44 |
|
#10 | |
Senior Member
Join Date: Feb 2011
Posts: 496
Rep Power: 18 |
Quote:
|
||
March 8, 2018, 06:27 |
|
#11 |
Senior Member
Gert-Jan
Join Date: Oct 2012
Location: Europe
Posts: 1,928
Rep Power: 28 |
I have a piece of Fortran that allows you to skip certain equations for a while in a transient calculation. Also it allows you to change the timestep when equations are skipped. So you can make it very large or very small, depending on your problem. I used it in a case where I skipped mass and momentum every 2 timesteps, while energy was solved using a large timestep. Interested? Send me a PM.
It is from 2006, not sure if it still works....... |
|
April 20, 2023, 11:58 |
|
#12 |
New Member
Jianfeng
Join Date: Apr 2021
Posts: 11
Rep Power: 5 |
Hi Gert, could you please show me the Fortran code since I need to freeze one variable field to make the solver stable, thanks a lot!
|
|
April 20, 2023, 20:03 |
|
#13 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
Don't forget that you can turn on and off equations with expert parameters. If that is what you want to do then that is much easier than fortran.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
|
April 25, 2023, 13:29 |
|
#14 | |
Senior Member
Join Date: Jun 2009
Posts: 1,880
Rep Power: 33 |
Quote:
There are plenty of ways to improve the robustness of the solution algorithm, and freezing the equations is very low on my list. In particular, if the equation has an indirect influence on the density
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
||
April 25, 2023, 14:08 |
|
#15 |
New Member
Jianfeng
Join Date: Apr 2021
Posts: 11
Rep Power: 5 |
Hi Opaque:
I am working on a chain reaction simulation in CFX. The model is like a gas transfer from the membrane to the blood side process. Thinking that high concentration oxygen from the membrane side enter the blood plasma through diffusion and then convects. Later the plasma gas enter the red blood cells to combine with the hemoglobin by Henry's law. So there are two species : plasma oxygen and hemoglobin oxygen. The source terms of their transport equation are coupled. In simulation, two species concentrations are changing so the source term changes a lot. I want to use something like the segregated solver to freeze one field first to make the other field converge. Because the source terms are kind of large and CFX doesn't support implicit source treatment, so my case always diverged even using the upwind scheme. |
|
April 25, 2023, 19:35 |
|
#16 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
Freezing one variable is not a very effective way to get a coupled set of variables to converge.
The normal way of getting tricky things to converge is described in this FAQ: https://www.cfd-online.com/Wiki/Ansy...gence_criteria
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
|
April 26, 2023, 02:34 |
|
#17 |
Senior Member
Gert-Jan
Join Date: Oct 2012
Location: Europe
Posts: 1,928
Rep Power: 28 |
The provided fortran is to freeze fluids and to solve energy and/or scalars with a larger timestep, in a transient calculation. Just to reduce calculation time. This worked pretty well for specific situation after tedious comparison of results with and without Fortran.
In your case it won't work since you can only turn of and on groups of equations, and not specific concentrations/massfractions. But I already told you in our PM. Better investigate if Fluent can help here of some other ANSYS tools for chemical reactions. |
|
April 26, 2023, 04:06 |
|
#18 |
New Member
Jianfeng
Join Date: Apr 2021
Posts: 11
Rep Power: 5 |
Thank you all so much, I will check the posts. I tried to use the Fluent but the multiphase flow field results have large discrepancies compared to the experiment. But CFX results are fine. So maybe I will try to use CFX for a while to see if this problem can be solved. Actually, I saw a post saying that I can construct a numerical fiction source that as the results are closer to the equilibrium, it converges to zero. If I find a way to solve it, I will post again!
|
|
April 26, 2023, 12:29 |
|
#19 |
Senior Member
Join Date: Jun 2009
Posts: 1,880
Rep Power: 33 |
For multi-component "reacting flow", the source terms are coupled as you have mentioned. Not certain if you have set up the problem using the Ansys CFX approach for reacting flows, or manually set the source/sink terms and linearized them yourself.
For your 2 species model, the source term linearization (Jacobian) contributions are represented by a 2x2 matrix block. Since the equations are solved in a segregated manner, the off-diagonal coefficients are being ignored and that could lead to some additional robustness issues that must be compensated elsewhere in the solution algorithm. If you set up the case manually, you can increase the Source Coefficient of the sources to account for the missing linearization, and slow down the influence of the new source on the equations, i.e. implicit source relaxation. If the sources are handled internally (using the Ansys CFX reacting flow approach), you can create a subdomain with a Source = 0, but a non-zero Source Coefficient to further linearized the species equation (that is what you referred previously)
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Free surface issues with interDyMFoam for hydroturbine | oumnion | OpenFOAM Running, Solving & CFD | 0 | October 6, 2017 15:05 |
should Courant number always be kept below 1? | wc34071209 | OpenFOAM Running, Solving & CFD | 16 | March 9, 2014 20:31 |
SLTS+rhoPisoFoam: what is rDeltaT??? | nileshjrane | OpenFOAM Running, Solving & CFD | 4 | February 25, 2013 05:13 |
pisoFoam with k-epsilon turb blows up - Some questions | Heroic | OpenFOAM Running, Solving & CFD | 26 | December 17, 2012 04:34 |
Orifice Plate with a fully developed flow - Problems with convergence | jonmec | OpenFOAM Running, Solving & CFD | 3 | July 28, 2011 06:24 |