amr-wind icon indicating copy to clipboard operation
amr-wind copied to clipboard

Tolerance issue when reading boundary data using `native` format

Open rthedin opened this issue 1 year ago • 1 comments

When running a case that takes boundary data as input, it fails on this assert: https://github.com/Exawind/amr-wind/blob/add85b1e6800a28023f0c535f426fd8f6a10106e/amr-wind/wind_energy/ABLBoundaryPlane.cpp#L766

I have a simple test case that starts at 19500 s, with boundary data saved starting at the same time. The format of the boundary data saved is native (as netcdf still seems to be really slow). I have added a few print statements right before the assert to try to debug it, and this is what I got:

--- DEBUG: m_in_times[0]       is  19500
--- DEBUG: m_in_times.back     is  19530.3
--- DEBUG: time                is  19500
--- DEBUG: time-m_in_times[0]  is  -2.391971066e-08

Given the value of time-m_in_times[0], it seems like a tolerance issue and something like an eps is needed somewhere in that assert statement. The case runs fine if I manually add, say, 19499.7 to the boundary data.

One additional piece of information: The simulation that saved the boundary data was split into two parts, the first ending at 19500 and the second starting at the same time. Since m_in_times[0] seem to be slightly (tolerance) higher than 19500, that could be one of the causes of the problem.

rthedin avatar Jan 03 '23 19:01 rthedin

This issue is stale because it has been open 30 days with no activity.

github-actions[bot] avatar Apr 29 '23 02:04 github-actions[bot]