-
Notifications
You must be signed in to change notification settings - Fork 61
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
Average velocity as initial condition #1215
Conversation
…t. ->added initial condition parameter file, erased multiphysics use average velocity profile, modified the read_checkpoint to take into account, set simulation time to 0 and erased precedent pvd info
…was not being solved. Changed some conditions to take this into account
…y as an initial condition has a bdf time stepping scheme
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a first batch of comments. I think it would be wise to add the documentation within this PR. Good job btw
applications_tests/lethe-fluid/cavity_ht_average_velocity_as_initial_condition.mpirun=1.output
Outdated
Show resolved
Hide resolved
applications_tests/lethe-fluid/cavity_ht_average_velocity_as_initial_condition.prm
Show resolved
Hide resolved
source/solvers/navier_stokes_base.cc
Outdated
Parameters::InitialConditionType::average_velocity_profile && | ||
this->simulation_parameters.restart_parameters.restart)) | ||
{ | ||
// std::cout << "Entering normally" << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// std::cout << "Entering normally" << std::endl; |
…estart with the initial condition. Scaling bug in average velocity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice feature!
So now if I understand correctly, we can run simulation that solve FD only while checkpointing, then run subsequent simulations where auxiliary physics are activated by using the proper type of initial condition? |
…have number of initial refinements set to 0. This generates an error message in debug mode. This has not been tested using pointwise meshes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last comment, but this is very good. There's just this "setting the time" that I am not sure about. Can you explain why you need to have the simulation control start at the new time? :)
// Fix the current time as final checkpointed time | ||
simulation_control_info[0] = last_checkpointed_time; | ||
|
||
// Fix time step to be the last time_step that was used | ||
simulation_control_info[1] = time_steps[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You really want to have the new simulation start at the time the previous one finished? why not restart it from zero? does that really pose a problem? I'm not sure what's the goal her (to me this is not intuitive, because if you set the initial condition, shouldnt the time be at zero still ? )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only to get end time for the average velocity calculation! The simulation time will be restarted from zero in the second simulation. This is necessary because of the way we calculate the average velocity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)perfect
The average velocity profile of an old simulation can now be used as an initial condition to a new simulation. The base mesh needs to stay the same, but auxiliary physics can now be added a posteriori without setting them as true in the initial simulation. The time stepping scheme can also be modified. Description The refactored restart mechanism had some problems: The auxiliary physics needed to be set as true while the average velocity profile was calculated. The matrix for the auxiliary physic was therefore assembled and could lead to useless memory and simulation time usage. The user could not choose to add an auxiliary physics to an already calculated average velocity profile if it was not specified in the initial simulation. This is because the restart mechanism would always search for a solution to the auxiliary physic in the checkpoint files even if it was non existent. In my opinion, the location of the "use average velocity profile = true" in the multiphysics subsection was somewhat awkward as the average velocity profile is not really an auxiliary physic. To solve these problems, the already implemented checkpoint mechanism is used. The simulation solving for the average velocity profile therefore needs to have checkpointing activated as well as the set calculate average velocities set to true (as before). Parameters in the initial condition section have been added as well as some conditions in the read_checkpoint() function. Conditions like: Do not search for a solution to the auxiliary physics if the average velocity is used as an initial condition. Do search for a solution to the auxiliary physics if the restart is normally used. Use the checkpoint file specified by the user in the appropriate initial condition section and not the simulation control section if the average velocity profile initial condition is used. Former-commit-id: d711d1f
The average velocity profile of an old simulation can now be used as an initial condition to a new simulation. The base mesh needs to stay the same, but auxiliary physics can now be added a posteriori without setting them as true in the initial simulation. The time stepping scheme can also be modified. Description The refactored restart mechanism had some problems: The auxiliary physics needed to be set as true while the average velocity profile was calculated. The matrix for the auxiliary physic was therefore assembled and could lead to useless memory and simulation time usage. The user could not choose to add an auxiliary physics to an already calculated average velocity profile if it was not specified in the initial simulation. This is because the restart mechanism would always search for a solution to the auxiliary physic in the checkpoint files even if it was non existent. In my opinion, the location of the "use average velocity profile = true" in the multiphysics subsection was somewhat awkward as the average velocity profile is not really an auxiliary physic. To solve these problems, the already implemented checkpoint mechanism is used. The simulation solving for the average velocity profile therefore needs to have checkpointing activated as well as the set calculate average velocities set to true (as before). Parameters in the initial condition section have been added as well as some conditions in the read_checkpoint() function. Conditions like: Do not search for a solution to the auxiliary physics if the average velocity is used as an initial condition. Do search for a solution to the auxiliary physics if the restart is normally used. Use the checkpoint file specified by the user in the appropriate initial condition section and not the simulation control section if the average velocity profile initial condition is used. Former-commit-id: d711d1f
The average velocity profile of an old simulation can now be used as an initial condition to a new simulation. The base mesh needs to stay the same, but auxiliary physics can now be added a posteriori without setting them as true in the initial simulation. The time stepping scheme can also be modified.
Description
The refactored restart mechanism had some problems:
To solve these problems, the already implemented checkpoint mechanism is used. The simulation solving for the average velocity profile therefore needs to have checkpointing activated as well as the set calculate average velocities set to true (as before). Parameters in the initial condition section have been added as well as some conditions in the read_checkpoint() function.
Conditions like:
Testing
A test using the average velocity profile was modified.
Documentation
Documentation will be added in a subsequent PR if all the modifications are accepted.
Miscellaneous (will be removed when merged)
An initial condition using the VTU files was attempted, but it is way easier to use the already existing checkpoint mechanism. No known function to retrieve the triangulation information from the vtu have been found in deal.II. The read_vtu() function is only oriented towards reading vtu meshes generated with deal.II.
Checklist (will be removed when merged)
See this page for more information about the pull request process.
Code related list:
Pull request related list: