|
[Sponsors] |
June 16, 2020, 04:23 |
Questions about the DEFINE_SOURCE
|
#1 |
New Member
Chris Hunter
Join Date: May 2020
Posts: 17
Rep Power: 6 |
Hello everybody,
I'd like to use fluent to solve Poisson equation. The Poisson equation is attached. But the simulation result is much higher than expected. I am not sure if I need to add some other terms (e.g., velocity term, transient term). in the equation. Or my code is wrong. Here is part of my code: DEFINE_SOURCE(potential,c,t,dS,eqn) { real source; source=F*(-C_UDSI(c,t,2)+C_UDSI(c,t,3)); dS[eqn]=0.0; return source; } Thanks a lot |
|
June 16, 2020, 07:39 |
Source
|
#2 |
Senior Member
|
Why do you have more than one UDS? And what are c, z, and F? Source should only have the right hand part of the equation.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 16, 2020, 15:36 |
|
#3 | |
New Member
Chris Hunter
Join Date: May 2020
Posts: 17
Rep Power: 6 |
Quote:
Another question is that the LHS is the second derivative of phi. I checked the UDF manual. And I found all of the equation on the LHS is the first derivative. I am not sure if I need to ingrate the LHS to make it first derivative of phi. Can you help me with this? Thanks a lot Last edited by mcc007; June 16, 2020 at 23:59. |
||
June 17, 2020, 05:19 |
Uds
|
#4 |
Senior Member
|
Do you have six different scalar equations to be solved? If yes, then six UDS are required. If you only have one Poisson equation with one variable, then you only need one UDS. Poisson equation always has Laplace operator, i.e., second derivative. It corresponds to diffusion term. So, no convection term needs to be included. is the diffusion coefficient for UDS. And the right hand side is the source term.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 18, 2020, 02:34 |
|
#5 |
New Member
Chris Hunter
Join Date: May 2020
Posts: 17
Rep Power: 6 |
Quote:
|
|
June 18, 2020, 04:10 |
Source
|
#6 |
Senior Member
|
DEFINE_SOURCE is used to provide source term. The RHS of the equation, i.e., , is the source and the UDF should return this value. But the UDF you have is not returning this.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 18, 2020, 20:08 |
|
#7 | |
New Member
Chris Hunter
Join Date: May 2020
Posts: 17
Rep Power: 6 |
Quote:
Thanks a lot |
||
June 19, 2020, 00:09 |
|
#8 |
New Member
Tu Can
Join Date: Jul 2017
Location: China
Posts: 16
Rep Power: 8 |
Is't your source should be something like this ?
Code:
for(j = 0; j < i; j++) { source += f * c_j * z_j } |
|
June 19, 2020, 00:30 |
|
#9 |
New Member
Chris Hunter
Join Date: May 2020
Posts: 17
Rep Power: 6 |
||
June 19, 2020, 06:12 |
Source
|
#10 | |
Senior Member
|
Quote:
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Map of the OpenFOAM Forum - Understanding where to post your questions! | wyldckat | OpenFOAM | 10 | September 2, 2021 05:29 |
[ICEM] Complex geometry mesh general questions | Jack B | ANSYS Meshing & Geometry | 0 | August 14, 2019 13:44 |
General questions about how to mesh and build up my case | ThunderstruckGER | OpenFOAM | 5 | September 23, 2018 18:33 |
possible interview questions | atturh | Main CFD Forum | 1 | February 21, 2012 08:53 |
NACA0012 Validation Case Questions | ozzythewise | Main CFD Forum | 3 | August 3, 2010 14:39 |