Home › Forum › SOFA › Using SOFA › TetrahedronDiffusionFEMForceField example
Tagged: 64_bits, Heat diffusion, SOFA_1806, Windows_7
- This topic has 7 replies, 2 voices, and was last updated 5 years, 8 months ago by Hugo.
-
AuthorPosts
-
28 March 2019 at 17:03 #13287simoncicBlocked
I am learning TetrahedronDiffusionFEMForceField example and I have two novice questions:
– Why there are FixedConstraint and LinearMovementConstraint for box-cold.indices? Is one for displacement and one for temperature?
– Where we actually define that diffusion equation should be used? By using TetrahedronDiffusionFEMForceField component? Why then is tags=”heat” for several components? Are these tags important?
29 March 2019 at 21:43 #13298HugoKeymasterHi @simoncic
The Constraint used in the TetrahedronDiffusionFEMForceField.scn are actually constraints on the temperature DOF. The FixedConstraint forces the temperature to remain constant, while the LinearMovementConstraint forces the evolution of temperature (at the head of the raptor).
I am not sure to understand your question “Where we actually define that diffusion equation should be used?”.
The TetrahedronDiffusionFEMForceField implements the diffusion, i.e. the Laplacian on the temperature field.
About the tags, it does not matter in this scene.Best
Hugo
31 March 2019 at 23:08 #13302simoncicBlockedThank you for the answer. So basically “ForceField” defines partial equation to be solved? Are then these tags ever inportant?
1 April 2019 at 19:35 #13325HugoKeymasterIndeed @simoncic
You perfectly understood it.
I am currently working on explaining these parts on the documentation. This will come soon (after the recent new doc theoretical page about integration using FEM).
All ForceFields are components that are adding forces. In continuum mechanics, these forces can be either internal or external forces. Internal forces corresponds to the effect of the soft body mechanics (elasticity, plasticity etc) and the external forces arise from external phenomenon (gravity, pressure etc).
In thermodynamics, all effects like diffusion, metabolic heat etc can be considered as ForceFields as well.
For your information tags, can be useful when you browse the graph and look for one specific component: for instance find one specific ForceField in the scene of there is several of them. It is mainly (but not limited to) used by solvers.
We would be glad to see new contributions in the thermodynamic field. Let us know whether you need more help.
Hope this helps.Best wishes,
Hugo
2 April 2019 at 14:41 #13354simoncicBlockedOK, things are becoming more clear 🙂
I am still wondering why this example has these two lines:
<FixedConstraint indices=”@../box-cold.indices” />
<LinearMovementConstraint template=”Vec1d” keyTimes=”0 0.005 0.006″ movements=”0 0 1″ indices=”@../box-cold.indices” />To my understanding, first line fix temperature to some value (zero?) for nodes in cold box, while next line set linear change of the temperature for the same nodes. Doesn’t second line override first line?
Is LinearMovementConstraint really linear? I.e. the temperature varies linearly (linear interpolation) between two nearby predefined points? Or is it piecewise constant (at predefined point is set to some value and kept constant until next point)?
I am also interested if it is possible to constrain partial derivative of the temperature in the direction of the surface; i.e. thermal flux.
2 April 2019 at 16:24 #13357HugoKeymasterHi @simoncic
The FixedConstraint actually enforces the derivative in time of the DOFs (derivative of temperature) to be zero. So it is a fixed temperature: where i corresponds to the indices. These indices are defined by a BoundingBox (box-cold).
The LinearMovementConstraint enforces temperature (and not the derivatives) to linearly evolve in time (keyTimes): e.g. between t=[0.005-0.006] the temperature linearly evolves between T=0 and T=1
To constrain the partial derivative of the temperature, you define the initial desired temperature and use the FixedConstraint to keep it constant. If you want to have a specific heat source, especially if you want to integrate it in space, it could be done as a ForceField if I understood your question correctly.
Can you give us more insight about the strong form of the differential equation you want to solve?
Best,
Hugo
2 April 2019 at 16:56 #13358simoncicBlockedHi Hugo,
but how can FixedConstraint and LinearMovementConstraint go together? First set derivative in time to zero – i.e. require constant temperature, but second require linear evolution in time, so the derivative in time is constant.By constraining partial derivatives I thought of a model, where I have a heat flux (heat power divided by surface area) over some surface. A very simplistic example would be some inflamed region inside the normal tissue that generates some known heat power/flux. I would like to evaluate stationary temperature spatial distribution in normal tissue. In the simplest scenario I would assume some constant temperature outside the normal tissue, constant flux on the border between inflamed region and normal tissue and I would evaluate stationary state by simulating state after long time. For modeling constant flux through the surface I think I have to constrain partial derivative on the surface. Is that doable and right way to go?
11 April 2019 at 11:54 #13394HugoKeymasterHi @simoncic
I never used both FixedConstraint and LinearMovementConstraint together on the same nodes myself. It does not seem to work. Here is an example on mechanics:
<Node name="root" dt="0.01" gravity="0 0 0"> <Node name="Particle" > <EulerImplicitSolver /> <!-- <EulerExplicitSolver /> --> <CGLinearSolver iterations="200" tolerance="1e-06" threshold="1e-06"/> <MechanicalObject template="Rigid" name="myParticle" position="0 0 0 0 0 0 1 1 0 0 0 0 0 1" showObject="1" /> <UniformMass totalMass="1" /> <ConstantForceField force="1 0 0 0 0 0" /> <LinearMovementConstraint indices="0" keyTimes="0 2 10 40 50" movements="0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 -1 0 0 0 1 0 0 -1 0 0 0 1 0 0 0 0 0 0 1" /> <FixedConstraint indices="0" /> </Node> </Node>
It is doable to make such a first simplistic simulation. To enforce the temperature at some nodes, a solution would be to use a FixedConstraint and modify the temperature on the fly with Python. For modeling a heat source, since it is comparable to a force, a ConstantForceField could be used for a constant flux (it is just a nodal force, not integrated in the volume).
I am following a starting project (for which I wrote you an email) on thermal simulation. We have some private codes for this, and I think it could be a nice collaboration. I stay at your disposal to chat further if needed.
Best
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.