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

Add time average temperature and time average heat flux to simulation output #1395

Merged
merged 10 commits into from
Dec 16, 2024

Conversation

mivaia
Copy link
Collaborator

@mivaia mivaia commented Dec 11, 2024

Description

Time averaged temperature can now be attached to the vtus using a new parameter in the post-processing subsection.

A new object AverageScalarInTime has been created. It can be used to calculate the time average temperature from a certain point in time. This object is greatly inspired by the AverageVelocity object in postprocessing_velocity.h.

The average heat transfer is then computed using the computed average temperature and the HeatFluxPostProcessor object.

Testing

Two new tests have been added.

  • heat_transfer_average_temperature -> Launch an application test to verify no problem using the object. Segfaults, parameter name, etc.
  • average_scalar_01.release -> to verify the computed average actually corresponds to the average of a scalar.

Documentation

Post processing subsection has been modified ta take into account the new parameter. The two new parameters are

calculate average temperature and average heat flux = true
initial time for average temperature and average heat flux = 0.0

Checklist (will be removed when merged)

See this page for more information about the pull request process.

Code related list:

  • All in-code documentation related to this PR is up to date (Doxygen format)
  • Copyright headers are present and up to date
  • Lethe documentation is up to date
  • New feature has unit test(s) (preferred) or application test(s), and restart files are in the generator folder
  • The branch is rebased onto master
  • Changelog (CHANGELOG.md) is up to date
  • Code is indented with indent-all and .prm files (examples and tests) with prm-indent

Pull request related list:

  • Labels are applied
  • There are at least 2 reviewers (or 1 if small feature) excluding the responsible for the merge
  • If this PR closes an issue or is related to a project, it is linked in the "Projects" or "Development" section
  • If the fix is temporary, an issue is opened
  • The PR description is cleaned and ready for merge

@mivaia mivaia added Enhancement New feature or request WIP When a PR is open but not ready for review labels Dec 11, 2024
@mivaia mivaia requested a review from blaisb December 11, 2024 20:03
@mivaia mivaia added Ready for review and removed WIP When a PR is open but not ready for review labels Dec 11, 2024
Copy link
Contributor

@blaisb blaisb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very few minor comments. This is very very good work. Good job man!

doc/source/parameters/cfd/post_processing.rst Outdated Show resolved Hide resolved
doc/source/parameters/cfd/post_processing.rst Outdated Show resolved Hide resolved
include/solvers/heat_transfer.h Outdated Show resolved Hide resolved
include/solvers/postprocessing_scalar.h Outdated Show resolved Hide resolved
source/solvers/heat_transfer.cc Outdated Show resolved Hide resolved
tests/solvers/average_scalar_01.cc Show resolved Hide resolved
Comment on lines +138 to +140
input >> buffer >> dt_0;
input >> buffer >> average_calculation;
input >> buffer >> real_initial_time;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use boost serialize for this but since we don't do it for the average velocity, what I would is open an issue, leave this PR as-is, and eventually migrate veerything to boost serialize. Although @lpsaavedra and I we had some issue with boost recently for unknown reasons.

@mivaia mivaia requested a review from blaisb December 12, 2024 21:53
Copy link
Contributor

@blaisb blaisb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mivaia Could you add a changelog entry then I will be able to merge. We should add a CHANGELOG entry for every PR now since we have moved to the numbered version ŗelease.

…e. Add preliminary code for the read_checkpoint function to consider the averaged scalars in the restarts. Code was not tested yet.
…rage temperature calculations. Modify a variable name and initial_time -> initial_time_for_average_velocity and all the files in which it was present.
…sfer.cc. Add a test to check if average is computed properly
…e heat flux is now outputed before initial_time_for_average_temperature_and_heat_flux
@blaisb blaisb force-pushed the add_average_heat_flux_in_post_processing branch from c8c9a29 to 6fe6a42 Compare December 16, 2024 20:23
@blaisb blaisb merged commit 02ef782 into master Dec 16, 2024
11 checks passed
@blaisb blaisb deleted the add_average_heat_flux_in_post_processing branch December 16, 2024 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants