CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Is define_source called after each iteration in a transient analysis? (https://www.cfd-online.com/Forums/fluent/186124-define_source-called-after-each-iteration-transient-analysis.html)

jyothsna k April 11, 2017 06:08

Is define_source called after each iteration in a transient analysis?
 
Is the DEFINE_SOURCE updated/called after each iteration in a transient analysis?

I would like to know this as i am using the axisymmetry option in fluent to solve a vector equation using the user defined Scalars. This requires me to transfer some UDS terms to the source (The actual source is function of time but is a constant in the domain over which it is defined). The value of these terms vary with each iteration as the solution converges.

My concern is if the Source term is getting updated at each step as this is what i require it to happen. If this doesn't happen, i will have to shift to a 3D model.

I would be thankful for any information regarding this.

mprinkey April 11, 2017 13:04

Yes. DEFINE_SOURCE is called to update the RHS and center coefficient of the A matrix before it is solved each iteration. I don't recall exactly when each is called *within* the iteration. For example, you are solving a vector equations as three UDS. I don't know if the just-solved UDS0 field will be used when calculating the source term for UDS1. It becomes a Gauss-Siedel vs Jaboci iteration situation.

It is pretty easy to figure these things out though...sprinkle some CX_Message() calls through out your UDFs, run a few iterations and diagnose the output. You will see exactly when and in what order your source functions are called. You can go a step further an turn up the verbosity on the linear equation solver and you can see when the source is called *relative* to the linear solve of each variable, including your UDSs. I do recommend doing this ONLY with a serial run. Parallel CX_Messages can quickly get out of order and out of hand, and often just confuse the situation further. Serial dumps should always be revelatory.

jyothsna k April 12, 2017 10:47

Is define_source called after each iteration in a transient analysis ... contd
 
Thank you very much for your quick response.
I am still a bit confused as i have to model a vector Laplacian in cylindrical coordinates. I therefore have only one UDS, say UDS(0),defined and one equation to solve. Since i only have the scalar axisymmetric transport equation available to me through Fluent, i transfer the one additional term in the vector Laplacian to 'Source'.

The source term is now Actual source+the additional term from the vector Laplacian.This additional term, in terms of UDS(0), keeps changing each iteration and so should the Source until convergence.
If i understand your answer right, this is what actually happens. Am i right?

I will try using CX_Message() too. Thanks for the suggestion

mprinkey April 12, 2017 21:23

I think you will have to show me your mathematical model for me to comprehend how you are modeling a "vector Laplacian" with a single scalar. Laplacian of a vector is a vector, AFAIK. But whatever you are doing in the DEFINE_SOURCE, it will be done updated every iteration of every timestep, yes.

Good luck.

jyothsna k April 13, 2017 04:06

Thanks again.
I transfer the 1/r^2 * (UDS(0))which is the additional term in the vector Laplacian (of the theta component alone) to the Source.
My equation is only in terms of the theta component .


All times are GMT -4. The time now is 10:34.