Home › Forum › SOFA › Programming with SOFA › How to set up parameters for "realistic" behaviour of a liver
Tagged: 64_bits, liver, parameters, realistic, simulation, SOFA_1706, Windows_10
- This topic has 1 reply, 2 voices, and was last updated 6 years, 9 months ago by Hugo.
-
AuthorPosts
-
11 March 2018 at 22:40 #10598SebRoBlocked
Hi,
I am trying to simulate some liver movements when grabbed/cut etc. and could not yet find out how to set the parameters the best way. This is also related to me now knowing exactly what every parameter does.
Right now the liver is moving way too “flabby”, more like a not fully blown up baloon or so.
Also when grabbed it might happen that the liver “flings” around, getting all spiky. Any suggestions on how to adjust the parameters or add new ones to make it move more realistically?
I also noticed that when scaling the liver down, the movement gets worse, especially when grabbed. How can I prevent this? Which parameter do I have to adjust to make the “grabbing force” fit the scaling?This is what the scene file looks like:
<?xml version="1.0" ?> <Node name="root" dt="0.3" showBoundingTree="0" gravity="0 -9.8 0"> <VisualStyle displayFlags="showBehaviorModels showVisual" /> <CollisionPipeline verbose="0" /> <BruteForceDetection name="N2" /> <CollisionResponse response="default" /> <MinProximityIntersection name="Proximity" alarmDistance="0.8" contactDistance="0.5" /> <CollisionGroup /> <!-- rotation="-40 150 80" translation="0 120 0" --> <Node name="FEM"> <EulerImplicit name="cg_odesolver" printLog="false" rayleighStiffness="0.1" rayleighMass="0.1" /> <CGLinearSolver iterations="40" name="linear solver" tolerance="1.0e-9" threshold="1.0e-9" /> <MeshGmshLoader name="loader" filename="./mesh/liver.msh" /> <MechanicalObject src="@loader" name="Volume" scale3d="0.75 0.75 0.75" translation="0 1.8 0" rotation="140 90 0"/> <TetrahedronSetTopologyContainer name="Container" position="@Volume.position" src="@loader" tags=" "/> <TetrahedronSetTopologyModifier name="Modifier" /> <TetrahedronSetTopologyAlgorithms name="TopoAlgo" template="Vec3d" /> <TetrahedronSetGeometryAlgorithms name="GeomAlgo" template="Vec3d" /> <DiagonalMass massDensity="1.0" /> <BoxROI template="Vec3d" box="-0.23 1.6 -0.45 0.3 2 0.6" drawBoxes="1" position="@Volume.rest_position" name="FixedROI"/> <FixedConstraint indices="@FixedROI.indices" /> <TetrahedralCorotationalFEMForceField name="FEM" youngModulus="12000" poissonRatio="0.3" method="large" /> <Node name="T"> <TriangleSetTopologyContainer name="Container" fileTopology="" tags=" " /> <TriangleSetTopologyModifier name="Modifier" /> <TriangleSetTopologyAlgorithms name="TopoAlgo" template="Vec3d" /> <TriangleSetGeometryAlgorithms name="GeomAlgo" template="Vec3d" /> <Tetra2TriangleTopologicalMapping input="@../Container" output="@Container" /> <TriangularBendingSprings name="FEM-Bend" stiffness="10000" damping="10.0" /> <TriangleSet /> <Node name="Surface"> <OglModel name="Visual" color="blue" /> <IdentityMapping input="@../../Volume" output="@Visual" /> </Node> </Node> </Node> </Node>
Thanks
15 March 2018 at 16:08 #10646HugoKeymasterHallo @sebro,
To find the right parameters of your simulation, do not forget to pay specific attention to you units (dimension of the meshes, mechanical parameters, mass density). A previous forum discussion already focused on this topic. Moreover, numerical settings (time step, iterations for the CG etc.) must be carefully chosen to ensure stability and convergence.
I don’t know why but in my case, the BoxROI does not fit the liver (not fixed BC).
Moreover, in your scene you are coupling a volumetric mechanical model (FEM based) of the liver and a surface model. Those two models make your liver very stiff. Moreover, the 3D volumetric model (liver.msh) is very coarse and won’t allow you to capture a detailed dynamics.
Please find below a modified version:
<?xml version="1.0" ?> <Node name="root" dt="0.02" showBoundingTree="0" gravity="0 -9.8 0"> <VisualStyle displayFlags="showBehaviorModels showVisual" /> <RequiredPlugin name='SofaMiscCollision'/> <CollisionPipeline verbose="0" /> <BruteForceDetection name="N2" /> <CollisionResponse response="default" /> <MinProximityIntersection name="Proximity" alarmDistance="0.8" contactDistance="0.5" /> <CollisionGroup /> <!-- rotation="-40 150 80" translation="0 120 0" --> <Node name="FEM"> <EulerImplicit name="cg_odesolver" printLog="false" rayleighStiffness="0.1" rayleighMass="0.1" /> <CGLinearSolver iterations="200" name="linear solver" tolerance="1.0e-9" threshold="1.0e-9" /> <MeshGmshLoader name="loader" filename="/data/Softwares/sofa/src/master/share/mesh/liver.msh" /> <MechanicalObject src="@loader" name="Volume" scale3d="0.75 0.75 0.75" translation="0 1.8 0" rotation="140 90 0"/> <TetrahedronSetTopologyContainer name="Container" position="@Volume.position" src="@loader" tags=" "/> <TetrahedronSetTopologyModifier name="Modifier" /> <TetrahedronSetTopologyAlgorithms name="TopoAlgo" template="Vec3d" /> <TetrahedronSetGeometryAlgorithms name="GeomAlgo" template="Vec3d" /> <DiagonalMass massDensity="1.0" /> <FixedConstraint indices="1 30 50" /> <TetrahedralCorotationalFEMForceField name="FEM" youngModulus="12000" poissonRatio="0.3" method="large" /> <Node name="T"> <TriangleSetTopologyContainer name="Container" fileTopology="" tags=" " /> <TriangleSetTopologyModifier name="Modifier" /> <TriangleSetTopologyAlgorithms name="TopoAlgo" template="Vec3d" /> <TriangleSetGeometryAlgorithms name="GeomAlgo" template="Vec3d" /> <Tetra2TriangleTopologicalMapping input="@../Container" output="@Container" /> <TriangleSet /> <Node name="Surface"> <OglModel name="Visual" color="blue" /> <IdentityMapping input="@../../Volume" output="@Visual" /> </Node> </Node> </Node> </Node>
Note that training sessions are available to address this kind of issues.
I hope this helps,Hugo Talbot
-
AuthorPosts
- You must be logged in to reply to this topic.