CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Additional Variable with only source term (https://www.cfd-online.com/Forums/cfx/211382-additional-variable-only-source-term.html)

ftab November 14, 2018 15:46

Additional Variable with only source term
 
Dear all,
As I am trying to solve an ODE for additional variable which looks like this:
dX/dt=aX+b


I tried with diffusion equation with Zero diffusivity, but Kin_Diff should be between 0 and 1. What should I do? Put Kin_Diff equal to 1e-100? Is there a better way? By the way, the source term was modeled as a subdomain and source. Was it correct?
Thanks

ghorrocks November 14, 2018 16:17

That should work. Yes, you can turn the diffusion off by setting a very low diffusivity.

ftab November 15, 2018 09:42

Quote:

Originally Posted by ghorrocks (Post 715471)
That should work. Yes, you can turn the diffusion off by setting a very low diffusivity.


Thanks a lot Glenn!
The simulation gave this error, but ran and converged:
Bounds error detected
---------------------
Variable: X.Dynamic Diffusivity
Locale : wall

Bounds error detected
---------------------
Variable: Y.Dynamic Diffusivity
Locale : wall

And this was for D=1e-40

ghorrocks November 15, 2018 16:30

Looks like 1e-40 is too low and triggers a bounds warning. Try 1e-10. And if you want to be sure do a sensitivity check to ensure that this value is low enough that it is effectively zero (that is, run 1e-9 and compare the results. If no significant difference then it is effectively zero).

ftab November 16, 2018 09:01

Quote:

Originally Posted by ftab (Post 715661)
Thanks a lot Glenn!
The simulation gave this error, but ran and converged:
Bounds error detected
---------------------
Variable: X.Dynamic Diffusivity
Locale : wall

Bounds error detected
---------------------
Variable: Y.Dynamic Diffusivity
Locale : wall

And this was for D=1e-40


Update:
This strategy works only for D up to 1e-15, as the truncation error of 1e-16 returns zero and bound error for the Diff coefficient

ghorrocks November 16, 2018 17:17

A minor point, but I don't think this is a truncation error. I think simply the bounds of that variable are set to 1e-15 and if you go below that it triggers the bounds error.


All times are GMT -4. The time now is 00:40.