Peano
Loading...
Searching...
No Matches
euler.py
Go to the documentation of this file.
4import peano4, exahype2
5
6domain_size = [120.0, 120.0]
7domain_offset = [-10.0, -60.0]
8
9min_level = 5 # Increase for finer mesh
10
11unknowns = {"p": 1, "v": 2, "E": 1}
12auxiliary_variables = {}
13max_h = 1.1 * min(domain_size) / (3.0**min_level)
14min_h = max_h
15
16my_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
26my_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 max_eigenvalue=exahype2.solvers.PDETerms.User_Defined_Implementation,
31)
32
33exahype2_project = exahype2.Project(
34 namespace=["tutorials", "exahype2", "euler"],
35 directory=".",
36 project_name="Airfoil",
37 executable="Airfoil",
38)
39
40exahype2_project.add_solver(my_solver)
41exahype2_project.set_output_path("solutions")
42
43exahype2_project.set_global_simulation_parameters(
44 dimensions=2,
45 size=domain_size,
46 offset=domain_offset,
47 min_end_time=10.0,
48 max_end_time=10.0,
49 first_plot_time_stamp=0.0,
50 time_in_between_plots=0.5,
51 periodic_BC=[False, False],
52)
53
54exahype2_project.set_load_balancer("new ::exahype2::LoadBalancingConfiguration")
55exahype2_project.set_Peano4_installation("../../../", peano4.output.CompileMode.Release)
56peano4_project = exahype2_project.generate_Peano4_project()
57peano4_project.output.makefile.add_cpp_file("EulerSolver.cpp")
58peano4_project.generate()
59peano4_project.build(make=True, make_clean_first=False, throw_away_data_after_build=False)