|
[Sponsors] |
September 14, 2018, 07:18 |
Fix negative values
|
#1 |
Member
Dimitrios S. P.
Join Date: Jan 2018
Posts: 63
Rep Power: 8 |
I have included an additional variable in my model, that flows under a convection-diffusion equation (in cfx transport). There is also a negative source (sink) . The analysis is transient, nad in the results the additional variable goes negative. I have included a source coefficient, but it still goes negative. What can I do about it, to constrain it from going negative?
|
|
September 16, 2018, 19:43 |
|
#2 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,872
Rep Power: 144 |
Are you sure your sink term is correct? If your sink term just pulls stuff out then it will just go negative.
If your additional variable is something which should not go negative (such as a concentration) you need a sink equation which reduces the amount pulled out to zero as you approach zero concentration.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
|
September 17, 2018, 06:26 |
|
#3 |
Senior Member
Gert-Jan
Join Date: Oct 2012
Location: Europe
Posts: 1,929
Rep Power: 28 |
Provided you implemented everything correctly, you might observe numerical over- and undershoots. So, reduce timestep and see if the problems reduces.
|
|
September 17, 2018, 10:25 |
|
#4 |
Member
Dimitrios S. P.
Join Date: Jan 2018
Posts: 63
Rep Power: 8 |
I cannot reduce timesteps, because my simulation is for 1 year. So every timestep is about 1 month. The problem is that even when I solve a problem with a timestep of minutes I still have negative values.
On other thing is that for every additional variable I have a source and a sink. The source does not depend on the additional variable itself, but the sink does. |
|
September 17, 2018, 10:27 |
|
#5 |
Member
Dimitrios S. P.
Join Date: Jan 2018
Posts: 63
Rep Power: 8 |
Also the additional variables are concentrations.
|
|
September 17, 2018, 19:37 |
|
#6 | |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,872
Rep Power: 144 |
Quote:
* Work out how big a simulation you need to run to get the accuracy you require, including mesh and time step size * Then you get a computer big enough to run the simulation in a time frame you are happy with. If you decide the computer you want to run on and how long the simulation is going to take, then guess what the accuracy of the simulation is going to be? Hopeless - the results are going to be useless and you were better off not doing the simulation at all because it will not tell you anything useful. So: You MUST determine the time step you need for accuracy first, even if that requires a huge run time. Once you have determined the accuracy you need you know what capacity computer you need to run it, and even if the simulation is viable at all. There are many CFD simulations which are just not viable to do on any computer as the resources required exceed the computing resources of the entire world (such as DNS of air flow over an aircraft). Can you post your CCL?
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
||
September 18, 2018, 05:42 |
|
#7 |
Member
Dimitrios S. P.
Join Date: Jan 2018
Posts: 63
Rep Power: 8 |
Is there any way to post it only to you Glenn?
|
|
September 18, 2018, 07:05 |
|
#8 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,872
Rep Power: 144 |
You can send me a PM (private message). But do not ask me CFD questions by PM, I will not answer it, as my signature says. CFD questions should be posted on the forum.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
|
September 18, 2018, 15:45 |
|
#9 |
Senior Member
Join Date: Jun 2009
Posts: 1,880
Rep Power: 33 |
If you are solving additional variables that are bounded, you must understand the numerics of the CFD code you are using.
The advection-diffusion transport equation with a source/sink will produce unbounded solutions during iterative convergence. The linearization of the source term (other terms are already handled internally) is critical to prevent the solution to become unbounded. Read the documentation for the treatment of the species equations or combustion models where bounded variables are computed, and try to implement the appropriate linearization. Not using the best linearization possible will force you to reduce the pseudo timestep considerably, and if you are lucky to obtain a solution at all. If you are solving for concentrations transport, may I ask why you cannot use the built-in equations for multi-component materials? |
|
September 21, 2018, 07:48 |
|
#10 |
Member
Dimitrios S. P.
Join Date: Jan 2018
Posts: 63
Rep Power: 8 |
I cannot use multi component materials, because some of the additional variables are human cells, for which there are no data for molar masses.
Also, in some of the components there is only a diffusion and not a convection term. So how can i model this in a multi-component flow. Even if there were values for molar masses, can I model a diffusion equation as an expression or there would be analysis errors? In reality cells are particles, which flow based only on diffusion. So I can't find an appropriate way to model this. Can you suggest me something? |
|
September 21, 2018, 21:13 |
|
#11 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,872
Rep Power: 144 |
Molar masses are only used in some fluid models. And sometimes an estimate is good enough. Don't just write it off out of hand.
For components which don't convect then yes, they should be an additional variable so you can model pure diffusion. If you could post your CCL that would help explain what you are doing.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
|
September 26, 2018, 07:56 |
|
#12 |
Member
Dimitrios S. P.
Join Date: Jan 2018
Posts: 63
Rep Power: 8 |
ok How can I upload a ccl file as attached?
|
|
September 26, 2018, 08:19 |
|
#13 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,872
Rep Power: 144 |
In CFX-Pre go File/export/CCL. Or right click on tree and view the CCL. Or go to the command line "cfx5cmds -read -def <def file name> -txt <Output text file.ccl>".
Then attach the text ccl file to your forum post.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
|
September 26, 2018, 08:35 |
|
#14 |
Member
Dimitrios S. P.
Join Date: Jan 2018
Posts: 63
Rep Power: 8 |
I know how to export a ccl, but not how to upload it here. were is the button for attachment?
|
|
September 26, 2018, 09:27 |
Is there any way to model a new material without molar mass?
|
#15 |
Member
Dimitrios S. P.
Join Date: Jan 2018
Posts: 63
Rep Power: 8 |
If I just copy paste it, it cannot be uploaded since it is larger than the limit of words
|
|
September 26, 2018, 19:16 |
|
#16 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,872
Rep Power: 144 |
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
|
September 28, 2018, 04:48 |
|
#17 |
Member
Dimitrios S. P.
Join Date: Jan 2018
Posts: 63
Rep Power: 8 |
this is the ccl. There are functions of variable's values at the inlet
|
|
October 2, 2018, 19:33 |
|
#18 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,872
Rep Power: 144 |
Your CEL is too complex for me to check. It is not realistic for me to go through this in detail. If you want me to check it you are going to have to simplify it.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
|
Tags |
negative values, source coefficient |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
using chemkin | JMDag2004 | OpenFOAM Pre-Processing | 2 | March 8, 2016 23:38 |
rhoSimpleFoam negative rho values | JuanRodriguez | OpenFOAM Pre-Processing | 0 | March 25, 2015 14:25 |
Mass flow rate boundary condition with negative values | ashtonJ | CFX | 3 | November 26, 2014 06:21 |
channelFoam for a 3D pipe | AlmostSurelyRob | OpenFOAM | 3 | June 24, 2011 14:06 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 15:00 |