You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR is a clean replacement for the previously closed pressure-initialization PR. It has been rebuilt on top of the latest main after the 3D–1D coupling changes were merged through PR #563.
Release Notes
Add support for initializing the entire 3D pressure field from a single scalar value specified in solver.xml.
Preserve the existing option to initialize pressure from a full 3D result file.
Initialize the first-step under-relaxation history for 3D–1D and 3D–0D coupling using the pressure and flow values computed from the initialized 3D state.
If both a nodewise pressure field and a scalar pressure are provided, the nodewise pressure field takes precedence.
Documentation
Initial_pressure_scalar is specified in the general simulation parameters in solver.xml.
Selecting an appropriate initial pressure can reduce initial pressure oscillations in standalone 3D simulations and coupled 3D–1D or 3D–0D simulations.
Testing
Successfully built on macOS using AppleClang 17.
Tested a parallel simulation using 8 MPI processes.
Verified that the 3D pressure field is initialized with the specified scalar value.
Verified initialization of the coupled 3D–1D pressure history using the initialized 3D state.
@taeoukkim The svMultiPhysics/tests/cases/struct/LV_NeoHookean_passive_sv0D_cap test is failing because CoupledBoundaryCondition::compute_flowrates is being called before CoupledBoundaryCondition::initialize_cap is called so the arrays in cap_global_mesh_state_ have not been allocated.
Sorry for not reviewing this yet! I'll do my best to look at the code in detail as soon as possible. In the meantime, I have a couple general (and perhaps naive) comments.
What is the implication of initializing the pressure to a given value, and to what model or set of models does it apply?
My understanding is that in Navier-Stokes the pressure does not have any initial conditions because the equations do not have any pressure time derivative in them. Whatever the initial value assigned to the pressure, it should immediately (at the first time step) be overwritten by whatever pressure is implied by the boundary conditions, which will have no "memory" of the initial condition.
Therefore, as far as I understand, for standalone Navier-Stokes, the initial pressure can at best have a "cosmetic" effect, in the sense that it can make sure that the output of the initial condition is somewhat in line with the outputs of the following frames (as opposed e.g. to being zero everywhere), but it should not have any effect on the solution. (Even if this is only cosmetic it is a useful thing to include, I just want to make sure I understand the maths).
I think that the picture is similar in the case of FSI, for similar reasons: the pressure at first timestep will only depend on the boundary conditions and the initial displacement of the solid, but should have no memory of the initial value assigned to it.
What I am not so sure about is how this looks in the context of 3D-1D or 3D-0D coupling. I still feel that something like what I wrote above should apply (even if the 1D or 0D model has a time derivative of pressure, or something related to it, that would apply to the 1D or 0D domain only, not to the 3D domain), but I am less familiar with the model and I'd be interested in understanding this better. Does this relate to the coupling algorithm?
To summarize, I'd be curious to understand more about the initial pressure oscillations that you talk about in the PR description, and where they come from.
On a more practical note: your PR description says that it is possible to specify both the nodal and constant pressure, and the former takes precedence. I would recommend disallowing this, and instead throwing an exception if they are both specified. This would prevent the user from specifying conflicting information in the XML file, which might be a sign that they're making some error that they'd rather find out about immediately.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current situation
Resolves #546.
This PR is a clean replacement for the previously closed pressure-initialization PR. It has been rebuilt on top of the latest
mainafter the 3D–1D coupling changes were merged through PR #563.Release Notes
solver.xml.The scalar pressure can be specified using:
If both a nodewise pressure field and a scalar pressure are provided, the nodewise pressure field takes precedence.
Documentation
Initial_pressure_scalaris specified in the general simulation parameters insolver.xml.Selecting an appropriate initial pressure can reduce initial pressure oscillations in standalone 3D simulations and coupled 3D–1D or 3D–0D simulations.
Testing
Code of Conduct & Contributing Guidelines