Hello, I am trying to apply k-e model to flow over 2D airfoil problem with Re = 1e5.
I have encountered a error when setting up the wall function constraint.
I generated a geometry that is a little bit thicker than the original airfoil, trying to make the y+ = 30. Then I use this as the geometry in the wall function constraint definition, as shown in the following:
wf_pt = PointwiseBoundaryConstraint(
nodes=nodes_ke + nodes_u_tau,
geometry=geo.airfoil1_geo,
outvar={
"velocity_wall_normal_wf": 0,
"velocity_wall_parallel_wf": 0,
"ep_wf": 0,
"k_wf": 0,
"wall_shear_stress_x_wf": 0,
"wall_shear_stress_y_wf": 0,
},
lambda_weighting={
"velocity_wall_normal_wf": 100,
"velocity_wall_parallel_wf": 100,
"ep_wf": 1,
"k_wf": 1,
"wall_shear_stress_x_wf": 100,
"wall_shear_stress_y_wf": 100,
},
batch_size=cfg.batch_size.wf_1,
parameterization={"normal_distance": resolved_y_start},
)
domain.add_constraint(wf_pt, "WF1")
Then I got the error report on this constraint, it is:
Error executing job with overrides: []
An error occurred during Hydra's exception formatting:
AssertionError()
Traceback (most recent call last):
File "/home/svu/e0444197/.local/lib/python3.8/site-packages/hydra/_internal/utils.py", line 252, in run_and_report
assert mdl is not None
AssertionError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "FX63-180_2_element_airfoil_varyAoA2_flow.py", line 672, in <module>
run()
File "/home/svu/e0444197/.local/lib/python3.8/site-packages/modulus-22.9-py3.8.egg/modulus/hydra/utils.py", line 91, in func_decorated
_run_hydra(
File "/home/svu/e0444197/.local/lib/python3.8/site-packages/hydra/_internal/utils.py", line 377, in _run_hydra
run_and_report(
File "/home/svu/e0444197/.local/lib/python3.8/site-packages/hydra/_internal/utils.py", line 294, in run_and_report
raise ex
File "/home/svu/e0444197/.local/lib/python3.8/site-packages/hydra/_internal/utils.py", line 211, in run_and_report
return func()
File "/home/svu/e0444197/.local/lib/python3.8/site-packages/hydra/_internal/utils.py", line 378, in <lambda>
lambda: hydra.run(
File "/home/svu/e0444197/.local/lib/python3.8/site-packages/hydra/_internal/hydra.py", line 111, in run
_ = ret.return_value
File "/home/svu/e0444197/.local/lib/python3.8/site-packages/hydra/core/utils.py", line 233, in return_value
raise self._return_value
File "/home/svu/e0444197/.local/lib/python3.8/site-packages/hydra/core/utils.py", line 160, in run_job
ret.return_value = task_function(task_cfg)
File "FX63-180_2_element_airfoil_varyAoA2_flow.py", line 240, in run
wf_pt = PointwiseBoundaryConstraint(
File "/home/svu/e0444197/.local/lib/python3.8/site-packages/modulus-22.9-py3.8.egg/modulus/domain/constraint/continuous.py", line 276, in __init__
invar = geometry.sample_boundary(
File "/home/svu/e0444197/.local/lib/python3.8/site-packages/modulus-22.9-py3.8.egg/modulus/geometry/geometry.py", line 474, in sample_boundary
[
File "/home/svu/e0444197/.local/lib/python3.8/site-packages/modulus-22.9-py3.8.egg/modulus/geometry/geometry.py", line 475, in <listcomp>
curve.approx_area(parameterization, criteria=closed_boundary_criteria)
File "/home/svu/e0444197/.local/lib/python3.8/site-packages/modulus-22.9-py3.8.egg/modulus/geometry/curve.py", line 129, in approx_area
s, p = self._sample(
File "/home/svu/e0444197/.local/lib/python3.8/site-packages/modulus-22.9-py3.8.egg/modulus/geometry/curve.py", line 211, in sample
invar, params = internal_sample(
File "/home/svu/e0444197/.local/lib/python3.8/site-packages/modulus-22.9-py3.8.egg/modulus/geometry/curve.py", line 268, in sample
computed_angle = angle(params)
File "/home/svu/e0444197/.local/lib/python3.8/site-packages/modulus-22.9-py3.8.egg/modulus/geometry/helper.py", line 97, in func
return fn_func(**inputs)
File "/home/svu/e0444197/.local/lib/python3.8/site-packages/modulus-22.9-py3.8.egg/modulus/utils/sympy/numpy_printer.py", line 144, in grouped_lambda
output.append(lambdify_f_i(**invar))
File "/home/svu/e0444197/.local/lib/python3.8/site-packages/modulus-22.9-py3.8.egg/modulus/utils/sympy/numpy_printer.py", line 113, in lambdify_f_i
v = np.stack(
File "<__array_function__ internals>", line 180, in stack
File "/usr/local/lib/python3.8/dist-packages/numpy/core/shape_base.py", line 422, in stack
raise ValueError('need at least one array to stack')
ValueError: need at least one array to stack
I have tried changing the geometry I provided to this constraint but it didn’t work. Can anyone help me with this problem?
Thank you very much