Skip to content

Documentation

Commando.PAX edited this page Feb 23, 2024 · 2 revisions

Config_Loader()

init (self)

The initialization function is responsible for loading the related json file with the problem parameters.

generate_new_config(self, ...)

This function generates a json file containing the problem parameters using user inputs. The json files obey the following formats (Sod Problem) :

{
    "gamma": 1.4, 
    "L": 1.0, 
    "n_cell": 1000,
    "C" : 0.9,
    "rho_inf": 1.0,
    "u_inf": 0.0,
    "P_inf": 1.0,
    "rho_sup": 0.125,
    "u_sup": 0.0,
    "P_sup": 0.1
}

Conservative_State_Solver

U_next (U : numpy.array, dx : float, intercell : str = "LF")

Uses the state of the physical system at a time t to calculate the state at the time t + delta_t(U[:, 1], a_(U[:, 2], U[:, 0]),dx). U = array([rho_i, u_i, P_i]) where i is the cell index, with this convention, U[:, 0] is every density, U[:, 1] every speed, U[:, 2] every pressure.

Returns : numpy.array

Physics

P_ (rho : numpy.array, K : float)

Computes the pressure using the polytropic equation of state with exponent gamma.

Returns : K * np.pow(rho,gamma)