|
[Sponsors] |
Custom source term in incompressible fluid flow simulation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 6, 2021, 17:31 |
Custom source term in incompressible fluid flow simulation
|
#1 |
New Member
Jaroslaw
Join Date: May 2021
Posts: 6
Rep Power: 5 |
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. |
|
June 7, 2021, 06:37 |
|
#2 | |
Member
Ole Burghardt
Join Date: Mar 2016
Location: Kiel, Germany
Posts: 60
Rep Power: 10 |
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 |
||
June 7, 2021, 08:11 |
|
#3 | |
New Member
Jaroslaw
Join Date: May 2021
Posts: 6
Rep Power: 5 |
Many thanks for replying to my post.
Quote:
Regards, Jaroslaw |
||
June 7, 2021, 17:17 |
|
#4 |
Senior Member
Pedro Gomes
Join Date: Dec 2017
Posts: 466
Rep Power: 13 |
Join the developers meeting https://meet.jit.si/SU2_DevMeeting Wednesday at 15h UK and show us the code.
|
|
June 8, 2021, 07:37 |
|
#5 |
Member
Ole Burghardt
Join Date: Mar 2016
Location: Kiel, Germany
Posts: 60
Rep Power: 10 |
Sounds like some SetTime_Step thing though. See you tomorrow maybe!
|
|
June 8, 2021, 09:33 |
|
#6 | |
New Member
Jaroslaw
Join Date: May 2021
Posts: 6
Rep Power: 5 |
Quote:
|
||
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |