CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   SU2 (https://www.cfd-online.com/Forums/su2/)
-   -   marker_inlet BC calculations (https://www.cfd-online.com/Forums/su2/136434-marker_inlet-bc-calculations.html)

LaSerpe May 28, 2014 10:47

marker_inlet BC calculations
 
Hi everybody, I'm a fresh user of SU2 and I'm just trying to figure out how it works, so I got a couple of basic questions.

I'm playing with boundary conditions and looking at config file for the channel with bump tutorial, I can see that total pressure and total temperature must be specified in order to obtain the desired mach speed.
I suppose that those values are calculated using isoentropic flow formula once the desired mach number is given, but I'm not sure where to specify the static values (of pressure and temp). Seems to me that this is done by imposing free-stream parameters, is this correct?

Also, always for this tutorial, I want to run a supersonic simulation and I noticed that there is a bc named MARKER_SUPERSONIC_INLET. So here's my question:
is somehow MARKER_INLET also good at specify supersonic bc, or I must use only the MARKER_SUPERSONIC_INLET? and in what src file can I find how these routines are defined?

Thank you very much for your time
Giulio

economon June 5, 2014 15:27

Hi Giulio,

Thanks for the questions, and I'm glad to hear that you are giving SU2 a try!

Indeed, we have typical characteristic-based inlet and outlet boundary conditions, which are suitable for internal flow calculations. The inlet condition can accept either total conditions (Ptot, Ttot) and a flow direction or mass flow (density and velocity vector). This for subsonic flow where information travels upstream and not all variables can be specified at the boundaries (see the CFD text by Hirsch for good discussion). In addition, internal flows will also usually depend on the outlet BC, where static pressure is typically imposed for subsonic flows. If the flow becomes supersonic in the channel, then no variables at the outlet are necessary, as all characteristics are leaving the domain at the outlet (i.e., no boundary condition is required).

However, in the supersonic inlet case, all of the characteristics are entering the domain, so all of the flow variables can be prescribed. Therefore, in the supersonic inlet BC, we allow for the imposition of all primitive variables.

You can find the routines for these BCs in the solver_direct_mean.cpp file within the SU2/SU2_CFD/src/ directory. In particular, check out the following:

void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker)
void CEulerSolver::BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_container,
CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker)
void CEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container,
CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker)

All the best,
Tom

LaSerpe June 6, 2014 04:33

Thanks for your answer Tom,
this last week I got into the code and found those routines.
I noticed that the method BC_Outlet is capable of understanding if the outflow is super/sub-sonic.
This doesn't happen for the BC_inlet, so I guess that this BC must be used only when facing subsonic inlet, does it?
i.e. this method is capable of imposing only the d + 2 - 1 quantities of the subsonic case, but not all of them if the inlet is supersonic

Indeed I tried to run bump channel tutorial imposing total values corresponding to supersonic flow (Mach=2, based on free-stream static values) and I get a very non-physical result.

Using BC_supersonic_inlet gives obviously good results ;)

So if everything is as I suppose (ie BC_inlet work only for subsonic case) my doubt arose only because I expected something called BC_subsonic_inlet.

Also, I gave a deeper look at the code and I was able to find almost everything I needed, but I couldn't identify the lines where the jacobian matrix are calculated, can you please tell me in which file this is done?

regards
Giulio

economon June 24, 2014 16:10

Indeed, while you can create a single inlet BC for both supersonic and subsonic, we have chosen a separate implementation for clarity. It is quite a bit simpler to combine them for the outlet condition (there is either a single upstream characteristic for subsonic, or none for subsonic, which makes the adjustment straightforward).

The Jacobian matrices for the various terms (convective fluxes, viscous fluxes, and source terms) will be found in their respective numerics classes. For instance, you can find the Jacobian for the JST scheme in the routine void CCentJST_Flow::ComputeResidual(double *val_residual, double **val_Jacobian_i, double **val_Jacobian_j,
CConfig *config) within numerics_direct_mean.cpp.

Cheers,
T


All times are GMT -4. The time now is 01:07.