Adding Custom Source Terms to Euler Equations
Hi all,
I'm new to CFD and su2. I'm trying to modify the c++ code to include the presence of a gravitational source term in the compressible Euler equations (SU2 Solver: EULER). There seems to be some old posts on the forum on the topic, but from many years back, and all point to files in the source code which have either changed name or simply do not exist anymore. I know that CEulerSolver.cpp has a void CEulerSolver::Source_Template method which also informs the programmer to first implement the source term in CNumerics.cpp. Does anyone have any experience with this kind of situation? I'm not sure what kind of syntax I should be using or how exactly to implement this source term. |
The code has that feature already, the relevant options are:
BODY_FORCE= YES BODY_FORCE_VECTOR= ( 0.0, -9.81, 0.0 ) |
Sorry to make this thread active again. Is there such a functionality for the heat equation?
|
No, I don't think we have anything that acts specifically on the heat equation (of the heat solver) nor on the energy equation (of the flow solvers).
If you are open to modify the code, this is a simple thing to do. |
I am open to modifying the code. I just need some guidance on what to modify as I am novice at SU2.
|
Ok, describe exactly what you want simulate and I'll tell you what to change.
|
Thank you for helping me out! I am looking to simulate a solid heat conduction with internal heat generation that is time varying.
|
In CHeatSolver.hpp you need to declare the method
Code:
void Source_Residual(CGeometry *geometry, The implementation should be placed in CHeatSolver.cpp, something like: Code:
void CHeatSolver::Source_Residual(CGeometry *geometry, If you need more help, join the Slack channel (follow the link above and click the # on the top bar) and come to one of the developers meetings (Wednesdays at 4pm CET, everyone is welcome and usually there is no agenda, so plenty of time for random questions). |
Wow! This is amazing! Thank you for sharing the code. I will try to implement it and let you know. Also, thank you for sharing the Slack link.
|
All times are GMT -4. The time now is 12:50. |