mirror of https://gitlab.com/pamhyr/pamhyr2
Solver: RubarBE: Fix study export and minor change.
parent
f97d4ce3c5
commit
4586ef79f7
|
|
@ -52,8 +52,8 @@ class Rubar3(CommandLineSolver):
|
||||||
("rubarbe_condav", "3"),
|
("rubarbe_condav", "3"),
|
||||||
("rubarbe_regime", "0"),
|
("rubarbe_regime", "0"),
|
||||||
("rubarbe_iodev", "n"),
|
("rubarbe_iodev", "n"),
|
||||||
("rubarbe_iodebord", ""),
|
# ("rubarbe_iodebord", ""),
|
||||||
("rubarbe_iostockage", ""),
|
# ("rubarbe_iostockage", ""),
|
||||||
("rubarbe_iopdt", "y"),
|
("rubarbe_iopdt", "y"),
|
||||||
("rubarbe_iovis", "n"),
|
("rubarbe_iovis", "n"),
|
||||||
("rubarbe_rep", "n"),
|
("rubarbe_rep", "n"),
|
||||||
|
|
@ -79,30 +79,30 @@ class Rubar3(CommandLineSolver):
|
||||||
# ("rubarbe_dm", "0.1"),
|
# ("rubarbe_dm", "0.1"),
|
||||||
# ("rubarbe_segma", "1.0"),
|
# ("rubarbe_segma", "1.0"),
|
||||||
# Sediment parameters
|
# Sediment parameters
|
||||||
("rubarbe_sediment_ros", "2650.0"),
|
# ("rubarbe_sediment_ros", "2650.0"),
|
||||||
("rubarbe_sediment_por", "0.4"),
|
# ("rubarbe_sediment_por", "0.4"),
|
||||||
("rubarbe_sediment_dcharg", "0.0"),
|
# ("rubarbe_sediment_dcharg", "0.0"),
|
||||||
("rubarbe_sediment_halfa", "1.0"),
|
# ("rubarbe_sediment_halfa", "1.0"),
|
||||||
("rubarbe_sediment_mult_1", "1.0"),
|
# ("rubarbe_sediment_mult_1", "1.0"),
|
||||||
("rubarbe_sediment_mult_2", ""),
|
# ("rubarbe_sediment_mult_2", ""),
|
||||||
("rubarbe_sediment_mult_3", ""),
|
# ("rubarbe_sediment_mult_3", ""),
|
||||||
("rubarbe_sediment_mult_4", ""),
|
# ("rubarbe_sediment_mult_4", ""),
|
||||||
("rubarbe_sediment_mult_5", ""),
|
# ("rubarbe_sediment_mult_5", ""),
|
||||||
("rubarbe_sediment_visc", "0.047"),
|
# ("rubarbe_sediment_visc", "0.047"),
|
||||||
("rubarbe_sediment_opts", "6"),
|
# ("rubarbe_sediment_opts", "6"),
|
||||||
("rubarbe_sediment_odchar", "0"),
|
# ("rubarbe_sediment_odchar", "0"),
|
||||||
("rubarbe_sediment_unisol", "1"),
|
# ("rubarbe_sediment_unisol", "1"),
|
||||||
("rubarbe_sediment_typdef", "3"),
|
# ("rubarbe_sediment_typdef", "3"),
|
||||||
("rubarbe_sediment_depot", "2"),
|
# ("rubarbe_sediment_depot", "2"),
|
||||||
("rubarbe_sediment_choixc", "2"),
|
# ("rubarbe_sediment_choixc", "2"),
|
||||||
("rubarbe_sediment_option", "2"),
|
# ("rubarbe_sediment_option", "2"),
|
||||||
("rubarbe_sediment_capsol", "1"),
|
# ("rubarbe_sediment_capsol", "1"),
|
||||||
("rubarbe_sediment_bmiu", "0.85"),
|
# ("rubarbe_sediment_bmiu", "0.85"),
|
||||||
("rubarbe_sediment_demix", "0"),
|
# ("rubarbe_sediment_demix", "0"),
|
||||||
("rubarbe_sediment_defond", "1"),
|
# ("rubarbe_sediment_defond", "1"),
|
||||||
("rubarbe_sediment_varcons", "1"),
|
# ("rubarbe_sediment_varcons", "1"),
|
||||||
("rubarbe_sediment_dchard", "0.0"),
|
# ("rubarbe_sediment_dchard", "0.0"),
|
||||||
("rubarbe_sediment_dchars", "0.0"),
|
# ("rubarbe_sediment_dchars", "0.0"),
|
||||||
]
|
]
|
||||||
|
|
||||||
return lst
|
return lst
|
||||||
|
|
@ -129,7 +129,7 @@ class Rubar3(CommandLineSolver):
|
||||||
|
|
||||||
def output_param(self):
|
def output_param(self):
|
||||||
name = self._study.name
|
name = self._study.name
|
||||||
return f"hydlim.{name}"
|
return f"profil.{name}"
|
||||||
|
|
||||||
def log_file(self):
|
def log_file(self):
|
||||||
name = self._study.name
|
name = self._study.name
|
||||||
|
|
@ -148,7 +148,7 @@ class Rubar3(CommandLineSolver):
|
||||||
self._export_stricklers(study, repertory, qlog, name=name)
|
self._export_stricklers(study, repertory, qlog, name=name)
|
||||||
self._export_hydro(study, repertory, qlog, name=name)
|
self._export_hydro(study, repertory, qlog, name=name)
|
||||||
self._export_condav(study, repertory, qlog, name=name)
|
self._export_condav(study, repertory, qlog, name=name)
|
||||||
self._export_abshyd(study, repertory, qlog, name=name)
|
# self._export_abshyd(study, repertory, qlog, name=name)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
@ -198,7 +198,7 @@ class Rubar3(CommandLineSolver):
|
||||||
v2 = next(it).value
|
v2 = next(it).value
|
||||||
v3 = next(it).value
|
v3 = next(it).value
|
||||||
|
|
||||||
f.write(f"{v2}{v3}")
|
# f.write(f"{v2}{v3}")
|
||||||
|
|
||||||
# New line
|
# New line
|
||||||
f.write(f"\n")
|
f.write(f"\n")
|
||||||
|
|
@ -332,7 +332,7 @@ class Rubar3(CommandLineSolver):
|
||||||
if ind % 3 != 0:
|
if ind % 3 != 0:
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
|
|
||||||
def _export_devers(self, study, repertory, qlog, name="0"):
|
def _export_abshyd(self, study, repertory, qlog, name="0"):
|
||||||
if qlog is not None:
|
if qlog is not None:
|
||||||
qlog.put("Export ABSHYD file")
|
qlog.put("Export ABSHYD file")
|
||||||
|
|
||||||
|
|
@ -354,7 +354,7 @@ class Rubar3(CommandLineSolver):
|
||||||
|
|
||||||
reach_ind += 1
|
reach_ind += 1
|
||||||
|
|
||||||
def _export_abshyd(self, study, repertory, qlog, name="0"):
|
def _export_devers(self, study, repertory, qlog, name="0"):
|
||||||
if qlog is not None:
|
if qlog is not None:
|
||||||
qlog.put("Export DEVERS file")
|
qlog.put("Export DEVERS file")
|
||||||
|
|
||||||
|
|
@ -428,9 +428,8 @@ class Rubar3(CommandLineSolver):
|
||||||
) as f:
|
) as f:
|
||||||
for edge in study.river.enable_edges():
|
for edge in study.river.enable_edges():
|
||||||
reach = edge.reach
|
reach = edge.reach
|
||||||
lm = len(reach) + 1
|
|
||||||
|
|
||||||
f.write(f"{0.0:>6.4f} {lm:>6}\n")
|
f.write(f"{0.0}\n")
|
||||||
|
|
||||||
ics = study.river.initial_conditions.get(edge)
|
ics = study.river.initial_conditions.get(edge)
|
||||||
data = self._export_condin_init_data(ics)
|
data = self._export_condin_init_data(ics)
|
||||||
|
|
@ -439,7 +438,8 @@ class Rubar3(CommandLineSolver):
|
||||||
first = profiles[0]
|
first = profiles[0]
|
||||||
last = profiles[-1]
|
last = profiles[-1]
|
||||||
|
|
||||||
if first.rk not in data or last.rk not in data:
|
if first not in data or last not in data:
|
||||||
|
print(data)
|
||||||
logger.error(
|
logger.error(
|
||||||
"Study initial condition is not fully defined"
|
"Study initial condition is not fully defined"
|
||||||
)
|
)
|
||||||
|
|
@ -457,7 +457,7 @@ class Rubar3(CommandLineSolver):
|
||||||
|
|
||||||
prev_h, prev_s = f_h_s
|
prev_h, prev_s = f_h_s
|
||||||
for profile in it:
|
for profile in it:
|
||||||
if profile.rk not in data:
|
if profile not in data:
|
||||||
ind += 1
|
ind += 1
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
@ -489,8 +489,8 @@ class Rubar3(CommandLineSolver):
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def _export_condin_profile_height_speed(self, profile, data):
|
def _export_condin_profile_height_speed(self, profile, data):
|
||||||
z = data[profile.rk][0]
|
z = data[profile][0]
|
||||||
q = data[profile.rk][1]
|
q = data[profile][1]
|
||||||
|
|
||||||
height = z - profile.z_min()
|
height = z - profile.z_min()
|
||||||
speed = profile.speed(q, z)
|
speed = profile.speed(q, z)
|
||||||
|
|
|
||||||
|
|
@ -608,7 +608,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||||
self._last_solver = solver
|
self._last_solver = solver
|
||||||
self.last_results = results
|
self.last_results = results
|
||||||
|
|
||||||
self._study.status.set_as_not_saved()
|
self._study.status._set_as_not_saved()
|
||||||
self.enable_actions("action_menu_results_last", True)
|
self.enable_actions("action_menu_results_last", True)
|
||||||
|
|
||||||
############
|
############
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue