Skip to content
Snippets Groups Projects
Commit eab9d9a7 authored by David Seus's avatar David Seus
Browse files

setup pure DD TPTP layered soil

parent 503628f5
No related branches found
No related tags found
No related merge requests found
...@@ -29,83 +29,83 @@ date = datetime.datetime.now() ...@@ -29,83 +29,83 @@ date = datetime.datetime.now()
datestr = date.strftime("%Y-%m-%d") datestr = date.strftime("%Y-%m-%d")
# Name of the usecase that will be printed during simulation. # Name of the usecase that will be printed during simulation.
use_case = "TP-R-layered-soil-with-inner-patch-realistic" use_case = "TP-R-layered-soil-with-inner-patch-realistic-recalculate-low-mesh-sizes-16-07"
# The name of this very file. Needed for creating log output. # The name of this very file. Needed for creating log output.
thisfile = "TP-R-layered_soil_with_inner_patch-realistic.py" thisfile = "TP-R-layered_soil_with_inner_patch-realistic.py"
# GENERAL SOLVER CONFIG ###################################################### # GENERAL SOLVER CONFIG ######################################################
# maximal iteration per timestep # maximal iteration per timestep
max_iter_num = 1000 max_iter_num = 2000
FEM_Lagrange_degree = 1 FEM_Lagrange_degree = 1
# GRID AND MESH STUDY SPECIFICATIONS ######################################### # GRID AND MESH STUDY SPECIFICATIONS #########################################
mesh_study = True mesh_study = True
resolutions = { resolutions = {
1: 5e-5, # h=2 1: 1e-5, # h=2
2: 5e-5, # h=1.1180 2: 1e-5, # h=1.1180
4: 5e-5, # h=0.5590 # 4: 1e-5, # h=0.5590
8: 5e-5, # h=0.2814 # 8: 1e-6, # h=0.2814
16: 3e-5, # h=0.1412 # 16: 1e-6, # h=0.1412
32: 5e-6, # 32: 5e-6,
64: 3e-6, # 64: 3e-6,
128: 2e-6 # 128: 2e-6
} }
# starttimes gives a list of starttimes to run the simulation from. # starttimes gives a list of starttimes to run the simulation from.
# The list is looped over and a simulation is run with t_0 as initial time # The list is looped over and a simulation is run with t_0 as initial time
# for each element t_0 in starttimes. # for each element t_0 in starttimes.
starttimes = {0: 0.0} starttimes = {0: 0.0}
timestep_size = 0.0025 timestep_size = 0.001
number_of_timesteps = 400 number_of_timesteps = 1000
# LDD scheme parameters ###################################################### # LDD scheme parameters ######################################################
Lw1 = 0.5 # /timestep_size Lw1 = 0.01 # /timestep_size
Lnw1 = 0.5 Lnw1 = 0.01
Lw2 = 0.5 # /timestep_size Lw2 = 0.01 # /timestep_size
Lnw2 = 0.5 Lnw2 = 0.01
Lw3 = 0.5 # /timestep_size Lw3 = 0.01 # /timestep_size
Lnw3 = 0.5 Lnw3 = 0.003
Lw4 = 0.5 # /timestep_size Lw4 = 0.01 # /timestep_size
Lnw4 = 0.5 Lnw4 = 0.003
Lw5 = 0.5 # /timestep_size Lw5 = 0.01 # /timestep_size
Lnw5 = 0.5 Lnw5 = 0.003
Lw6 = 0.5 # /timestep_size Lw6 = 0.01 # /timestep_size
Lnw6 = 0.5 Lnw6 = 0.003
lambda12_w = 40 lambda12_w = 0.5
lambda12_nw = 4 lambda12_nw = 0.5
lambda23_w = 40 lambda23_w = 0.5
lambda23_nw = 4 lambda23_nw = 0.5
lambda24_w = 40 lambda24_w = 0.5
lambda24_nw= 4 lambda24_nw= 0.5
lambda25_w= 40 lambda25_w= 0.5
lambda25_nw= 4 lambda25_nw= 0.5
lambda34_w = 40 lambda34_w = 0.5
lambda34_nw = 4 lambda34_nw = 0.5
lambda36_w = 40 lambda36_w = 0.5
lambda36_nw = 4 lambda36_nw = 0.5
lambda45_w = 40 lambda45_w = 0.5
lambda45_nw = 4 lambda45_nw = 0.5
lambda46_w = 40 lambda46_w = 0.5
lambda46_nw = 4 lambda46_nw = 0.5
lambda56_w = 40 lambda56_w = 0.5
lambda56_nw = 4 lambda56_nw = 0.5
include_gravity = True include_gravity = False
debugflag = False debugflag = False
analyse_condition = False analyse_condition = False
...@@ -453,10 +453,12 @@ if __name__ == '__main__': ...@@ -453,10 +453,12 @@ if __name__ == '__main__':
for mesh_resolution, solver_tol in resolutions.items(): for mesh_resolution, solver_tol in resolutions.items():
simulation_parameter.update({"solver_tol": solver_tol}) simulation_parameter.update({"solver_tol": solver_tol})
hlp.info(simulation_parameter["use_case"]) hlp.info(simulation_parameter["use_case"])
processQueue = mp.Queue()
LDDsim = mp.Process( LDDsim = mp.Process(
target=hlp.run_simulation, target=hlp.run_simulation,
args=( args=(
simulation_parameter, simulation_parameter,
processQueue,
starttime, starttime,
mesh_resolution mesh_resolution
) )
...@@ -468,3 +470,10 @@ if __name__ == '__main__': ...@@ -468,3 +470,10 @@ if __name__ == '__main__':
# starttime=starttime, # starttime=starttime,
# parameter=simulation_parameter # parameter=simulation_parameter
# ) # )
LDDsim.join()
if mesh_study:
simulation_output_dir = processQueue.get()
hlp.merge_spacetime_errornorms(isRichards=isRichards,
resolutions=resolutions,
output_dir=simulation_output_dir)
...@@ -48,7 +48,7 @@ resolutions = { ...@@ -48,7 +48,7 @@ resolutions = {
# 4: 1e-6, # 4: 1e-6,
# 8: 1e-5, # 8: 1e-5,
# 16: 5e-6, # 16: 5e-6,
32: 5e-6, 32: 1e-6,
# 64: 2e-6, # 64: 2e-6,
# 128: 1e-6, # 128: 1e-6,
# 256: 1e-6, # 256: 1e-6,
...@@ -64,21 +64,21 @@ number_of_timesteps = 1 ...@@ -64,21 +64,21 @@ number_of_timesteps = 1
# LDD scheme parameters ###################################################### # LDD scheme parameters ######################################################
Lw1 = 0.05 # /timestep_size Lw1 = 0.01 # /timestep_size
Lnw1 = 0.01 Lnw1 = 0.01
Lw2 = 0.05 # /timestep_size Lw2 = 0.01 # /timestep_size
Lnw2 = 0.007 Lnw2 = 0.01
Lw3 = 0.01 # /timestep_size Lw3 = 0.001 # /timestep_size
Lnw3 = 0.005 Lnw3 = 0.001
Lw4 = 0.01 # /timestep_size Lw4 = 0.001 # /timestep_size
Lnw4 = 0.0005 Lnw4 = 0.001
lambda12_w = 4 lambda12_w = 40
lambda12_nw = 0.5 lambda12_nw = 40
lambda23_w = 4 lambda23_w = 40
lambda23_nw = 0.5 lambda23_nw = 40
lambda34_w = 4 lambda34_w = 40
lambda34_nw = 0.5 lambda34_nw = 40
include_gravity = False include_gravity = False
debugflag = False debugflag = False
...@@ -180,7 +180,7 @@ porosity = { ...@@ -180,7 +180,7 @@ porosity = {
1: 0.37, # 0.2, # Clayey gravels, clayey sandy gravels 1: 0.37, # 0.2, # Clayey gravels, clayey sandy gravels
2: 0.022, # 0.22, # Silty gravels, silty sandy gravels 2: 0.022, # 0.22, # Silty gravels, silty sandy gravels
3: 0.002, # 0.37, # Clayey sands 3: 0.002, # 0.37, # Clayey sands
4: 0.00022, # 0.2 # Silty or sandy clay 4: 0.002, # 0.2 # Silty or sandy clay
} }
# subdom_num : subdomain L for L-scheme # subdom_num : subdomain L for L-scheme
...@@ -254,7 +254,7 @@ p_e_sym_2patch = { ...@@ -254,7 +254,7 @@ p_e_sym_2patch = {
1: {'wetting': -7 - (1+t*t)*(1 + x*x + y*y), 1: {'wetting': -7 - (1+t*t)*(1 + x*x + y*y),
'nonwetting': -1-t*(1.1 + y + x**2)**2}, 'nonwetting': -1-t*(1.1 + y + x**2)**2},
2: {'wetting': -7.0 - (1.0 + t*t)*(1.0 + x*x), 2: {'wetting': -7.0 - (1.0 + t*t)*(1.0 + x*x),
'nonwetting': -1-t*(1.1 + x**2)**2 - sym.sqrt(5+t**2)*y**2}, 'nonwetting': -1-t*(1.1 + x**2)**2 - (1+t**2)*y**2},
} }
......
...@@ -31,7 +31,7 @@ datestr = date.strftime("%Y-%m-%d") ...@@ -31,7 +31,7 @@ datestr = date.strftime("%Y-%m-%d")
# Name of the usecase that will be printed during simulation. # Name of the usecase that will be printed during simulation.
use_case = "TP-TP-layered_soil-realistic-not-VanGenuchten" use_case = "TP-TP-layered_soil-realistic"
# The name of this very file. Needed for creating log output. # The name of this very file. Needed for creating log output.
thisfile = "TP-TP-layered_soil.py" thisfile = "TP-TP-layered_soil.py"
...@@ -48,7 +48,7 @@ resolutions = { ...@@ -48,7 +48,7 @@ resolutions = {
# 4: 1e-6, # 4: 1e-6,
# 8: 1e-5, # 8: 1e-5,
# 16: 5e-6, # 16: 5e-6,
32: 1e-6, 32: 1e-7,
# 64: 2e-6, # 64: 2e-6,
# 128: 1e-6, # 128: 1e-6,
# 256: 1e-6, # 256: 1e-6,
...@@ -64,21 +64,21 @@ number_of_timesteps = 1 ...@@ -64,21 +64,21 @@ number_of_timesteps = 1
# LDD scheme parameters ###################################################### # LDD scheme parameters ######################################################
Lw1 = 0.1 Lw1 = 0.001
Lnw1 = 0.1 Lnw1 = 0.0001
Lw2 = 0.1 Lw2 = 0.001
Lnw2 = 0.1 Lnw2 = 0.0001
Lw3 = 0.1 Lw3 = 0.001
Lnw3 = 0.1 Lnw3 = 0.0001
Lw4 = 0.1 Lw4 = 0.001
Lnw4 = 0.1 Lnw4 = 0.0001
lambda12_w = 20 lambda12_w = 2
lambda12_nw = 20 lambda12_nw = 2
lambda23_w = 20 lambda23_w = 2
lambda23_nw = 20 lambda23_nw = 2
lambda34_w = 20 lambda34_w = 2
lambda34_nw = 20 lambda34_nw = 2
include_gravity = False include_gravity = False
debugflag = False debugflag = False
...@@ -122,7 +122,7 @@ else: ...@@ -122,7 +122,7 @@ else:
write_to_file = { write_to_file = {
'space_errornorms': True, 'space_errornorms': True,
'meshes_and_markers': True, 'meshes_and_markers': True,
'L_iterations_per_timestep': False, 'L_iterations_per_timestep': True,
'solutions': True, 'solutions': True,
'absolute_differences': True, 'absolute_differences': True,
'condition_numbers': analyse_condition, 'condition_numbers': analyse_condition,
...@@ -234,10 +234,10 @@ ka_prime = rel_perm_dict["ka_prime"] ...@@ -234,10 +234,10 @@ ka_prime = rel_perm_dict["ka_prime"]
# S-pc relation # S-pc relation
Spc_on_subdomains = { Spc_on_subdomains = {
1: {"vanGenuchten": {"n": 3, "alpha": 0.1}}, 1: {"vanGenuchten": {"n": 3, "alpha": 0.001}},
2: {"vanGenuchten": {"n": 3, "alpha": 0.1}}, 2: {"vanGenuchten": {"n": 3, "alpha": 0.001}},
3: {"vanGenuchten": {"n": 6, "alpha": 0.1}}, 3: {"vanGenuchten": {"n": 6, "alpha": 0.001}},
4: {"vanGenuchten": {"n": 6, "alpha": 0.1}}, 4: {"vanGenuchten": {"n": 6, "alpha": 0.001}},
} }
# Spc_on_subdomains = { # Spc_on_subdomains = {
# 1: {"testSpc": {"index": 1}}, # 1: {"testSpc": {"index": 1}},
...@@ -260,7 +260,7 @@ p_e_sym_2patch = { ...@@ -260,7 +260,7 @@ p_e_sym_2patch = {
1: {'wetting': -7.0 - (1.0 + t*t)*(1.0 + x*x + y*y), 1: {'wetting': -7.0 - (1.0 + t*t)*(1.0 + x*x + y*y),
'nonwetting': -1 - t*(1.1 + y + x**2)**2}, 'nonwetting': -1 - t*(1.1 + y + x**2)**2},
2: {'wetting': -7.0 - (1.0 + t*t)*(1.0 + x*x), 2: {'wetting': -7.0 - (1.0 + t*t)*(1.0 + x*x),
'nonwetting': -1-t*(1.1 + x**2)**2}, 'nonwetting': (-1.0 - t*(1.1 + x**2)**2 - (2+t**2))*y**2},
} }
......
...@@ -36,7 +36,7 @@ thisfile = "TP-TP-layered_soil_pure_dd.py" ...@@ -36,7 +36,7 @@ thisfile = "TP-TP-layered_soil_pure_dd.py"
# GENERAL SOLVER CONFIG ###################################################### # GENERAL SOLVER CONFIG ######################################################
# maximal iteration per timestep # maximal iteration per timestep
max_iter_num = 10 max_iter_num = 2000
FEM_Lagrange_degree = 1 FEM_Lagrange_degree = 1
# GRID AND MESH STUDY SPECIFICATIONS ######################################### # GRID AND MESH STUDY SPECIFICATIONS #########################################
...@@ -47,7 +47,7 @@ resolutions = { ...@@ -47,7 +47,7 @@ resolutions = {
# 4: 1e-6, # 4: 1e-6,
# 8: 1e-5, # 8: 1e-5,
# 16: 5e-6, # 16: 5e-6,
32: 5e-6, 32: 4e-6,
# 64: 2e-6, # 64: 2e-6,
# 128: 1e-6, # 128: 1e-6,
# 256: 1e-6, # 256: 1e-6,
...@@ -57,39 +57,40 @@ resolutions = { ...@@ -57,39 +57,40 @@ resolutions = {
# The list is looped over and a simulation is run with t_0 as initial time # The list is looped over and a simulation is run with t_0 as initial time
# for each element t_0 in starttimes. # for each element t_0 in starttimes.
starttimes = {0: 0.0} starttimes = {0: 0.0}
# starttimes = {0: 0.0, 1: 0.3, 2: 0.6, 3: 0.9}
timestep_size = 0.001 timestep_size = 0.001
number_of_timesteps = 5 number_of_timesteps = 1500
# LDD scheme parameters ###################################################### # LDD scheme parameters ######################################################
Lw1 = 0.025 # /timestep_size Lw1 = 0.02 # /timestep_size
Lnw1 = Lw1 Lnw1 = 0.0025
Lw2 = 0.025 # /timestep_size Lw2 = 0.02 # /timestep_size
Lnw2 = Lw2 Lnw2 = 0.0025
Lw3 = 0.025 # /timestep_size Lw3 = 0.02 # /timestep_size
Lnw3 = Lw3 Lnw3 = 0.0025
Lw4 = 0.025 # /timestep_size Lw4 = 0.02 # /timestep_size
Lnw4 = Lw4 Lnw4 = 0.0025
lambda12_w = 40 lambda12_w = 0.5
lambda12_nw = 40 lambda12_nw = 0.5
lambda23_w = 40 lambda23_w = 0.5
lambda23_nw = 40 lambda23_nw = 0.5
lambda34_w = 40 lambda34_w = 0.5
lambda34_nw = 40 lambda34_nw = 0.5
include_gravity = False include_gravity = False
debugflag = True debugflag = False
analyse_condition = False analyse_condition = False
# I/O CONFIG ################################################################# # I/O CONFIG #################################################################
# when number_of_timesteps is high, it might take a long time to write all # when number_of_timesteps is high, it might take a long time to write all
# timesteps to disk. Therefore, you can choose to only write data of every # timesteps to disk. Therefore, you can choose to only write data of every
# plot_timestep_every timestep to disk. # plot_timestep_every timestep to disk.
plot_timestep_every = 1 plot_timestep_every = 3
# Decide how many timesteps you want analysed. Analysed means, that # Decide how many timesteps you want analysed. Analysed means, that
# subsequent errors of the L-iteration within the timestep are written out. # subsequent errors of the L-iteration within the timestep are written out.
number_of_timesteps_to_analyse = 1 number_of_timesteps_to_analyse = 10
# fine grained control over data to be written to disk in the mesh study case # fine grained control over data to be written to disk in the mesh study case
# as well as for a regular simuation for a fixed grid. # as well as for a regular simuation for a fixed grid.
...@@ -249,7 +250,7 @@ x, y = sym.symbols('x[0], x[1]') # needed by UFL ...@@ -249,7 +250,7 @@ x, y = sym.symbols('x[0], x[1]') # needed by UFL
t = sym.symbols('t', positive=True) t = sym.symbols('t', positive=True)
p_e_sym_2patch = { p_e_sym_2patch = {
1: {'wetting': -7 - (1+t*t)*(1 + x*x + y*y), 1: {'wetting': -7.0 - (1.0 + t*t)*(1.0 + x*x + y*y),
'nonwetting': -1-t*(1.1 + y + x**2)}, 'nonwetting': -1-t*(1.1 + y + x**2)},
2: {'wetting': -7.0 - (1.0 + t*t)*(1.0 + x*x + y*y), 2: {'wetting': -7.0 - (1.0 + t*t)*(1.0 + x*x + y*y),
'nonwetting': -1-t*(1.1 + y + x**2)}, 'nonwetting': -1-t*(1.1 + y + x**2)},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment