Custom source term in incompressible fluid flow simulation
Dear SU2 Users,
I am a very beginner at using SU2 and need more detailed instructions on how to implement a user-defined source term in an incompressible fluid flow simulation. More precisely, I am not completely sure how to set the gradient of my own source term, which is a function of the flow velocity, fluid density, and some cell-defined external quantities that I provide to the solver via a text file. I implemented a specialized CNumerics class, and overwritten the definition of the method 'ComputeResidual'. Here I compute my special momentum- (in N) and energy-source term (in W) and an approximation of the Jacobian (diagonal values) with respect to the conservative variables. So far so good, I am using INC_RANS solver with active INC_ENERGY_EQUATION, SST turbulence model, and INC_IDEAL_GAS fluid model. For small geometries, the defined solver converges (in temperature residual) and returns a reasonable solution. However, I have the impression that the gradient information of the new source term has only a little effect (if any at all). I would expect that by providing the correct gradient (or at least a good approximation) of the main ingredient that drives the simulation we reduce the required number of iterations. This is not the case in my example. No matter if I define the gradients or not, the solution process looks the same. For larger geometries (with several thousands of nodes), it is not likely to converge at all. Furthermore, updating the global Jacobian with the diagonal entries of the true Jacobian of my source term does not help. This observation prompts me to ask the following questions: What is the correct way of defining the Jacobian for a custom source term? Is there a configuration parameter that controls whether the user-defined gradients are used in the solver? I believe it is worth mentioning that a similar approach works in Fluent with the use of user-defined functions. I appreciate your help. |
Hi,
Quote:
You could check your residual implementation first by using an explicit time stepping and if everything's fine, you go back to the Jacobian issue. Best, Ole |
Many thanks for replying to my post.
Quote:
Regards, Jaroslaw |
Join the developers meeting https://meet.jit.si/SU2_DevMeeting Wednesday at 15h UK and show us the code.
|
Sounds like some SetTime_Step thing though. See you tomorrow maybe!
|
Quote:
|
All times are GMT -4. The time now is 12:34. |