Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More precision needed in boundary I/O time.dat file #870

Closed
lawrenceccheung opened this issue Jul 4, 2023 · 3 comments
Closed

More precision needed in boundary I/O time.dat file #870

lawrenceccheung opened this issue Jul 4, 2023 · 3 comments

Comments

@lawrenceccheung
Copy link
Contributor

If we're using the native format for the boundary I/O files, then it writes out an text file called time.dat to index the iteration numbers against the simulation time. However, if the simulation proceeds long enough, there isn't enough precision in the file to accommodate the exact times. This is what it looks like with dt=0.25 and t>10000:

60000 15000
60001 15000.2
60002 15000.5
60003 15000.8
60004 15001
60005 15001.2
60006 15001.5
60007 15001.8
60008 15002
60009 15002.2

This is not a huge problem, but there will be slight errors accumulating as it interpolates the boundary data against the wrong times.

The fix looks pretty straightforward, looks like we need to add a precision modifier to

std::ofstream oftime(m_time_file, std::ios::out | std::ios::app);
oftime << t_step << ' ' << time << '\n';
oftime.close();

Let me look and see if this type of problem appears anywhere else.

Lawrence

@github-actions
Copy link

github-actions bot commented Aug 4, 2023

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

@github-actions
Copy link

github-actions bot commented Sep 4, 2023

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

marchdf pushed a commit that referenced this issue Jan 3, 2024
* Increased precision of ABLBoundaryPlane::write_file() output

* Fix formatting
@marchdf
Copy link
Contributor

marchdf commented Jan 3, 2024

Closed in #947

@marchdf marchdf closed this as completed Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants