Skip to content

Commit 9ccc733

Browse files
CopilotSierd
andauthored
Add validation to prevent steadystate solver with multiple sediment fractions (#258)
* Initial plan * Add validation to prevent steadystate solver with multiple sediment fractions Co-authored-by: Sierd <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Sierd <[email protected]>
1 parent b4abb48 commit 9ccc733

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

aeolis/inout.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,13 @@ def check_configuration(p):
220220
logger.warning('Warning: the used roughness method (constant) defines the z0 as '
221221
'k (z0 = k), this was implemented to ensure backward compatibility '
222222
'and does not follow the definition of Nikuradse (z0 = k / 30).')
223+
224+
# check if steadystate solver is used with multiple sediment fractions
225+
if p['solver'].lower() in ['steadystate', 'steadystatepieter']:
226+
if len(p['grain_size']) > 1:
227+
logger.log_and_raise('The steadystate solver is not compatible with multiple sediment fractions. '
228+
'Please use a single sediment fraction or switch to a different solver (e.g., trunk or pieter).',
229+
exc=ValueError)
223230

224231

225232
def parse_value(val, parse_files=True, force_list=False):

0 commit comments

Comments
 (0)