On 10/23/2015 12:39 PM, Patricia Garcia Cañadilla wrote:
Dear Robert,
Yes :), it would be nice if we could easily implement this in sfepy by modifying fibre_function i and creating a new term very similar to FibresActiveTLTerm. I am very new in this field, so could you give me some key starting points on how to do it?
Sure:
make a copy of FibresActiveTLTerm (-> FibresActive2TLTerm (better name?)) and fibre_function() (-> fibre_function2() (better name?)) in the same file.
modify the attributes of the new class:
- name (dw_tl_fib_a2?)
- arg_types, arg_shapes - add kappa
add the new material argument also to .get_fargs()
See also [1] but do no worry - here it is just the above.
[1] http://sfepy.org/doc-devel/developer_guide.html#how-to-implement-a-new-term
Then you would need to compute the rate of the fibre deformation eps. The fibre deformation is computed in fibre_function(), line 16. It might be better to compute that directly in .get_fargs(), and store the current eps as self.eps0 in the class, to be able to get the rate as deps = (eps - eps0) / dt.
Then having eps and deps, update the new fibre_function2() to compute the active tension (fmode == 0), as well as its derivative w.r.t. eps (fmode == 1), just like it is done in fibre_function()
Another quick question, is, regarding the first term in the expression of active stress which is "viscosity coefficient*strain rate", is what you refer when you said "creating a new term", and then the exponential term should be introduced by modifying the term_fibers?
Above I am talking about adding the "exp{k min(0;de/dt}}" to the exponential term. FibresActiveTLTerm in sfepy is exactly the exponential term without the "exp{k min(0;de/dt}}" part. But you can add also "viscosity coefficient*strain rate" in there, so that the new term computes the entire relation (9). If you manage to add there the exponential part, adding this is trivial. :)
Does this help?
r.
Thank you very much!
El viernes, 23 de octubre de 2015, 11:33:27 (UTC+2), Robert Cimrman escribió:
Dear Patricia,
On 10/23/2015 10:39 AM, Patricia Garcia Cañadilla wrote:
Dear Robert,
I would like to the model the viscoelastic behavior of active fibers, as you done in the paper: "Modelling heart tissue using a composite muscle model with blood perfusion" or as here:
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.488.5795&rep=rep1&type=pdf and
I was wondering if is easy to implemented in sfepy and/or if there is some predefined term in Sfepy, since for example the term "dw_tl_fib_a" doesn't include the "exp{k min(0;de/dt}}" that appears in the paper.
The model from the "Modelling heart tissue using a composite muscle model with blood perfusion" paper would be pretty easy to add, yes. It would involve modifying fibre_function() in sfepy/terms/terms_fibres.py and creating a new term very similar to FibresActiveTLTerm. Would you give it a shot? :)
As for the cardiac model, it would certainly be possible to implement those fibres in sfepy, but not that easy - the model is quite complex. The biggest issue are the internal unknown variables (the contractile element deformation epsilon_c), that evolve in quadrature points - those are not supported (yet).
r.