Skip to content

master-csmi/2024-m1-hyperbolique

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adaptive Implicit Schemes for Hyperbolic Equations

This project focuses on studying adaptive theta schemes for equations such as the linear transport equation.

SATh_utilities.py contains all the methods. To load a simulation, modify the parameters as you wish in the args.json file, and run simulation.py:

args.json: the JSON file to set up your parameters. You can leave it empty, the program has an initial dictionary containing default values. Change only the parameters that interest you:

  • "a" & "b": coordinates of the borders of the 1D domain.

  • "Nx": number of spatial nodes.

  • "cfl": CFL condition.

  • "mesh_type": only one type is available yet: "offset_constantDx".

  • "params": The coordinates defining your wave or perturbation. Must always be a list (one or two elements).

  • "init_func": the type of funtion we want to study.

  • "tf": the duration of the simulation.

  • "Theta_st": The parameter $\theta^*$.

  • "Theta_min": The parameter $\theta_{min}$.

  • "Theta_max": in the case of the simple Theta Scheme only: the maximum value of theta we want a simulation with.

  • "Scheme": The type of Scheme: "Theta" or "SATh",

  • "Boundary": The type of boundary. Always use "constant", but "periodical" works well for the simple Theta Scheme.

Run one simulation and obtain the corresponding plot:

python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
source .venv/bin/activate
python3 simulation.py plot

Repository and tests

  • texdir contains the .tex files and possibly other documents, images and texts.

  • pictures is where the plots are saved.
    There are no fundamental code tests for this project other than the workflow that compiles and run our python code. For the implementation, as explained in the report, one small test is suggested: by setting $\theta^* = 1$ and $\theta_{min} = 1$ and launch a SATh, we obtain a similar result that a standard implicit scheme.