Skip to content
Snippets Groups Projects
Commit 9c53ce93 authored by Martin Bauer's avatar Martin Bauer
Browse files

Bugfix when using default relaxation rate and stencil with Q >10

parent ec7ebd18
No related branches found
No related tags found
No related merge requests found
......@@ -167,7 +167,7 @@ def updateWithDefaultParameters(params, optParams, failOnUnknownParameter=True):
defaultMethodDescription = {
'stencil': 'D2Q9',
'method': 'srt', # can be srt, trt or mrt
'relaxationRates': sp.symbols("omega_:10"),
'relaxationRates': None,
'compressible': False,
'equilibriumAccuracyOrder': 2,
'c_s_sq': sp.Rational(1, 3),
......@@ -238,6 +238,15 @@ def updateWithDefaultParameters(params, optParams, failOnUnknownParameter=True):
paramsResult.update(params)
optParamsResult = copy(defaultOptimizationDescription)
optParamsResult.update(optParams)
if paramsResult['relaxationRates'] is None:
stencilParam = paramsResult['stencil']
if isinstance(stencilParam, tuple) or isinstance(stencilParam, list):
stencilEntries = stencilParam
else:
stencilEntries = getStencil(paramsResult['stencil'])
paramsResult['relaxationRates'] = sp.symbols("omega_:%d" % len(stencilEntries))
return paramsResult, optParamsResult
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment