dycove.sim.base.HydroSimulationBase
- class dycove.sim.base.HydroSimulationBase(engine)[source]
Base class for running hydrodynamic simulations.
This class is model-agnostic: it is a high-level wrapper that manages the time stepping logic, both for the hydrodynamic and vegetation components.
Model-specific computations are delegated to the appropriate
HydroEngineBase. Tracking of simulation time state variables is delegated to theSimulationTimeStatedataclass. Calculation of hydrodynamic statistics relevant for vegetation processes is handled by theHydrodynamicStatsdataclass. Coupling logic between vegetation and hydrodynamic models is managed byVegetationCoupler. Writing of output files is performed by theOutputManagerclass.Methods
__init__(engine)eco_hydro_loop(n_substeps, interval)Advance hydrodynamics over all substeps within the current vegetation step.
finalize_simulation()hydro_step(seconds)Advance hydrodynamics by a specified interval
run_simulation(sim_time, sim_time_unit[, ...])Run a full simulation over the specified time period.
run_simulation_with_vegetation()run_simulation_without_vegetation()verify_eco_args(inputs)- eco_hydro_loop(n_substeps, interval)[source]
Advance hydrodynamics over all substeps within the current vegetation step.
Computes min/max water depths, maximum velocities, and flooding statistics (HydrodynamicStats) required for vegetation updates.
- run_simulation(sim_time, sim_time_unit, n_ets=14, veg_interval=43200, hydro_interval=900, save_interval=3600, ecofac=None, save_frequency=1, save_mortality=True)[source]
Run a full simulation over the specified time period.
This method handles the main simulation loop, including:
Initializing the engine
Creating
SimulationTimeStateandHydrodynamicStatsobjectsRunning vegetation and hydrodynamic loops
Saving outputs
- Parameters:
sim_time (float) – Simulation duration in units of
sim_time_unit.sim_time_unit (str) – Either
'hydrodynamic days'or'eco-morphodynamic years'. Determines interpretation ofsim_time.n_ets (int, optional) – Number of ecological time steps per vegetation year. Default is 14.
veg_interval (int, optional) – Time interval in seconds between vegetation updates. Default is 43200 (12 hours).
hydro_interval (int, optional) – Time interval in seconds between hydrodynamic substeps. Default is 900 (15 minutes).
save_interval (int, optional) – Interval in seconds for writing outputs. Default is 3600 (1 hour).
ecofac (int, optional) – Ecological (vegetation) acceleration factor relative to hydrodynamics. Must equal
MORFACif Delft3D morphology is enabled. IfNone, it is computed automatically.save_frequency (int, optional) – Integer defining an output “skip” interval, e.g., 2 means skip every other ETS when writing output files. Default is 1 (no skip).
save_mortality (bool, optional) – Flag for saving mortality fractions with vegetation output.