Peano
euler.py
Go to the documentation of this file.
1 
4 import peano4, exahype2
5 
6 domain_size = [120.0, 120.0]
7 domain_offset = [-10.0, -60.0]
8 
9 min_level = 5 # Increase for finer mesh
10 
11 unknowns = {"p": 1, "v": 2, "E": 1}
12 auxiliary_variables = {}
13 max_h = 1.1 * min(domain_size) / (3.0**min_level)
14 min_h = max_h
15 
16 my_solver = exahype2.solvers.fv.godunov.GlobalAdaptiveTimeStep(
17  name="EulerSolver",
18  patch_size=22,
19  min_volume_h=min_h,
20  max_volume_h=max_h,
21  time_step_relaxation=0.5,
22  unknowns=unknowns,
23  auxiliary_variables=auxiliary_variables,
24 )
25 
26 my_solver.set_implementation(
27  initial_conditions=exahype2.solvers.PDETerms.User_Defined_Implementation,
28  boundary_conditions=exahype2.solvers.PDETerms.User_Defined_Implementation,
29  flux=exahype2.solvers.PDETerms.User_Defined_Implementation,
30 )
31 
32 exahype2_project = exahype2.Project(
33  namespace=["tutorials", "exahype2", "euler"],
34  directory=".",
35  project_name="Airfoil",
36  executable="Airfoil",
37 )
38 
39 exahype2_project.add_solver(my_solver)
40 exahype2_project.set_output_path("solutions")
41 
42 exahype2_project.set_global_simulation_parameters(
43  dimensions=2,
44  size=domain_size,
45  offset=domain_offset,
46  min_end_time=10.0,
47  max_end_time=10.0,
48  first_plot_time_stamp=0.0,
49  time_in_between_plots=0.5,
50  periodic_BC=[False, False],
51 )
52 
53 exahype2_project.set_load_balancer("new ::exahype2::LoadBalancingConfiguration")
54 exahype2_project.set_Peano4_installation("../../../", peano4.output.CompileMode.Release)
55 peano4_project = exahype2_project.generate_Peano4_project()
56 peano4_project.output.makefile.add_cpp_file("EulerSolver.cpp")
57 peano4_project.generate()
58 peano4_project.build(make=True, make_clean_first=False, throw_away_data_after_build=False)
static double min(double const x, double const y)