Skip to content

Print the material models used in each simulation - #118

Open
simonecap00 wants to merge 1 commit into
masterfrom
print-material-models
Open

simonecap00 wants to merge 1 commit into
masterfrom
print-material-models

Conversation

@simonecap00

Copy link
Copy Markdown

Related to KVSlab/VaSP#241

Summary

After assigning the properties to each region, monolithic.py printed the solid and fluid regions as raw
dictionaries, and solid.py printed the Robin boundaries and coefficients line by line. This PR replaces these
prints with one block that shows, for each region, the material model actually used and its parameters:

=============================== Material models ================================
Solid region dx_s_id=2: MooneyRivlin
    rho_s = 1.0000e+03, mu_s = 3.4483e+05, lambda_s = 3.1034e+06, C01 = 2.0000e+04, C10 = 0.0000e+00, C11 = 1.8000e+06
Fluid region dx_f_id=1: Newtonian
    rho_f = 1.0250e+03, mu_f = 3.5000e-03
Robin boundary condition: on
    ds_s_id = 33: k_s = 1.0000e+05, c_s = 1.0000e+01
================================================================================

Motivation

The printed default_variables show the top-level material_model. When the model is given in solid_properties,
that value is the default (StVenantKirchoff) even if, for example, MooneyRivlin is used. It is then easy to
misread 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: new print_material_models().
    • Solid regions: model and parameters, with the parameters required by the model first.
    • Fluid regions: Newtonian, or non-Newtonian (modified Cross) with its parameters when nonnewtonian is set.
      It reads nonnewtonian/cross_params only if they are defined, so it works with or without
      Add non-Newtonian (modified Cross) viscosity model for the fluid #115.
    • Robin boundary condition: its boundaries and coefficients.
    • Fluid- or solid-only problems: fluid="no_fluid" / solid="no_solid" are shown as "not solved".
  • turtleFSI/monolithic.py: calls print_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: ... and No entry for viscoelasticity ...). The message for an invalid
    viscoelasticity entry is kept.

The computations are unchanged. Only the printed output changes, and the tests do not parse these lines.

Verification

  • tests/test_turtleFSI.py passes on master with this PR (12 tests).
  • tests/test_nonnewtonian.py passes on the branch of Add non-Newtonian (modified Cross) viscosity model for the fluid #115 with this PR (3 tests). The changed files are
    identical on master and on that branch, and the patch applies to both.
  • The changes were developed and tested on top of the branch of Add non-Newtonian (modified Cross) viscosity model for the fluid #115 (non-Newtonian fluid), and
    also work on master without it.
  • With this PR, the block was checked in a VaSP pre-deformation run (MooneyRivlin solid, Robin boundary condition).
    It was also checked with direct calls of print_material_models(): two MooneyRivlin regions, a non-Newtonian
    fluid, and no_solid/no_fluid.
  • The same block, printed earlier from VaSP during development, was checked in VaSP simulations (cylinder, offset
    stenosis with two fluid regions, aneurysm with the Robin boundary condition, a non-Newtonian fluid).

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.
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

Successfully merging this pull request may close these issues.

1 participant