Repository navigation
Print the material models used in each simulation - #118
Open
simonecap00 wants to merge 1 commit into
Open
simonecap00 wants to merge 1 commit into
simonecap00 wants to merge 1 commit into
Conversation
Replace the raw prints of the solid and fluid regions in monolithic.py with a block that shows, for each region, the material model actually used and its parameters, and the Robin boundary condition (print_material_models in modules/domain.py). Remove the prints in solid.py made redundant by the block.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related to KVSlab/VaSP#241
Summary
After assigning the properties to each region,
monolithic.pyprinted the solid and fluid regions as rawdictionaries, and
solid.pyprinted the Robin boundaries and coefficients line by line. This PR replaces theseprints with one block that shows, for each region, the material model actually used and its parameters:
Motivation
The printed
default_variablesshow the top-levelmaterial_model. When the model is given insolid_properties,that value is the default (
StVenantKirchoff) even if, for example, MooneyRivlin is used. It is then easy tomisread which model a simulation runs with. This matters, for example, when a pre-deformation and the subsequent
FSI simulation must use the same model. The block shows the model and parameters that are actually used, in every
simulation.
Changes
turtleFSI/modules/domain.py: newprint_material_models().nonnewtonianis set.It reads
nonnewtonian/cross_paramsonly if they are defined, so it works with or withoutAdd non-Newtonian (modified Cross) viscosity model for the fluid #115.
fluid="no_fluid"/solid="no_solid"are shown as "not solved".turtleFSI/monolithic.py: callsprint_material_models()instead of the raw prints.turtleFSI/modules/solid.py: removes the prints made redundant by the block (Robin BC is used ...,solid_boundaries: ...,k_s: ..., c_s: ...andNo entry for viscoelasticity ...). The message for an invalidviscoelasticity entry is kept.
The computations are unchanged. Only the printed output changes, and the tests do not parse these lines.
Verification
tests/test_turtleFSI.pypasses on master with this PR (12 tests).tests/test_nonnewtonian.pypasses on the branch of Add non-Newtonian (modified Cross) viscosity model for the fluid #115 with this PR (3 tests). The changed files areidentical on master and on that branch, and the patch applies to both.
also work on master without it.
It was also checked with direct calls of
print_material_models(): two MooneyRivlin regions, a non-Newtonianfluid, and
no_solid/no_fluid.stenosis with two fluid regions, aneurysm with the Robin boundary condition, a non-Newtonian fluid).