CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > SU2

Custom source term in incompressible fluid flow simulation

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   June 6, 2021, 17:31
Default Custom source term in incompressible fluid flow simulation
  #1
New Member
 
Jaroslaw
Join Date: May 2021
Posts: 6
Rep Power: 4
jw-89 is on a distinguished road
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.
jw-89 is offline   Reply With Quote

 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Intuition for why flow follows convex surfaces lopp Main CFD Forum 47 February 1, 2022 13:14
what is swap4foam ?? AB08 OpenFOAM 28 February 2, 2016 01:22
[Other] How to use finite area method in official OpenFOAM 2.2.0? Detian Liu OpenFOAM Meshing & Mesh Conversion 4 November 3, 2015 03:04
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 19:08
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 09:11


All times are GMT -4. The time now is 08:51.