Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Writing custom Biphasic code

  1. #1
    Join Date
    Apr 2019
    Location
    Graz, Austria
    Posts
    25

    Default Writing custom Biphasic code

    Hello,

    I would like to write my own code for biphasic analysis with different assumptions and a few more changes, especially I want to add mass supply term and remove pressure gradient. Also, I want to have a custom material model. For the material model I can use the material plugin method but how can I join the biphasic code to the simulation or is there any template already that I could use?

    PS: By custom Biphasic code, I mean that I want to code the balance equations by myself

    Best Regards,
    Ishan
    Last edited by ishangupta000794; 09-20-2019 at 04:55 AM.

  2. #2
    Join Date
    Nov 2007
    Location
    Salt Lake City, UTAH
    Posts
    2,030

    Default

    Hi Ishan,

    Writing your own biphasic solver will be quite an undertaking, but you should be able to do it with the plugin framework. You will need to do at least the following:
    - create a new solver class, derived from FENewtonSolver that will implement the Quasin method, the Residual, and StiffnessMatrix functions (and a few other).
    - create a new domain class that will implement the volume integrals of the formulation. You also need to implement a domain factory class that will create this domain based on some information that is passed by the user (or read from the input file to be more precise)
    - create a new material class that will hold the material properties.
    - if your formulation has surface integrals, like applied fluid flux, you may need to implement classes derived from FESurfaceLoad.

    With that as a guide, I suggest to first copy the biphasic code into a new plugin and try to get your plugin to do the same as the FEBio code. Then, with your plugin working and reproducing part of the biphasic code in FEBio, you can make your desired changes and implement your custom materials.

    Unfortunately, we don't have any documentation on writing entire new solvers as plugins, but you might want to take a look at the FEBioChem plugin, since it implements a complete nonlinear solver plugin and many of the classes here you will also need to implement.

    Let us know if you have any further questions and good luck

    Cheers,

    Steve
    Department of Bioengineering, University of Utah
    Scientific Computing and Imaging institute, University of Utah

  3. #3
    Join Date
    Apr 2019
    Location
    Graz, Austria
    Posts
    25

    Default

    Hello Steve,

    Thank you for such a detailed answer. Is there a simpler way to add only the "mass supply/production term" for solid phase?

    Also, the following might be stupid questions but I'm not very sure how to begin with this.

    As you have suggested to copy and run the biphasic code as a plugin, do you mean that I should create a complete plugin folder with solvers and other codes(copied needed for biphasic analysis from the source code) as in the case of FEBioChem plugin and then try running it?

    Can the files like 'FEBioMech/FEElasticMaterial.h' included in biphasic code be read by the plugin itself or do I need to add them to the plugin folder? I understand if that if I need changes in such kind of files, I should have them in the plugin folder but do I need to that otherwise?

    Also, where are the solver files for FEBiphasic code? To be specific, residuals and tolerance. I can see the matrix and other calculations in the code.

    I would really appretite your help in this regard.

    Best Regards,
    Ishan
    Last edited by ishangupta000794; 09-24-2019 at 03:37 AM.

  4. #4
    Join Date
    Apr 2019
    Location
    Graz, Austria
    Posts
    25

    Default

    Hello Steve,

    Could you please reply to my questions soon?

    Thank You,
    Ishan Gupta

  5. #5
    Join Date
    Dec 2007
    Posts
    863

    Default

    Hi Ishan,

    Is there a simpler way to add only the "mass supply/production term" for solid phase?
    Adding a mass supply/production term for the solid phase would require updating the biphasic module as Steve mentioned. The simpler way is to use the existing multiphasic module, which currently includes a mass supply/production term for the solid phase. The multiphasic module includes biphasic materials as a special case (i.e., no solutes). If you choose to use this module you will not have to write an entire plugin to extend the biphasic module. If you would like some assistance with this, please provide us with some more details about the type of mass supply you need for the solid (e.g., a model, or an equation, or a literature reference).
    do you mean that I should create a complete plugin folder with solvers and other codes(copied needed for biphasic analysis from the source code) as in the case of FEBioChem plugin and then try running it?
    Yes.
    Can the files like 'FEBioMech/FEElasticMaterial.h' included in biphasic code be read by the plugin itself or do I need to add them to the plugin folder?
    They can be read by the plugin itself.
    I understand if that if I need changes in such kind of files, I should have them in the plugin folder
    Yes, and you need to rename them. FEElasticMaterial is a base class inherited by all elastic materials, so you should be careful to change this base class.
    Also, where are the solver files for FEBiphasic code? To be specific, residuals and tolerance.
    All the relevant biphasic files are in the FEBioMix folder. The biphasic solver is FEBiphasicSolver. It is class inherited from the solid solver FEBioMech/FESolidSolver2, so it only includes the pressure tolerance.

    Best,

    Gerard

  6. #6
    Join Date
    Apr 2019
    Location
    Graz, Austria
    Posts
    25

    Default

    Hello Gerard,

    I have attached the pdf of literature. I want to reproduce this model. Equation number 4 is the mass supply term.
    I would really appretiate if you could assist me with this.

    Best Regards,
    Ishan
    Attached Files Attached Files

  7. #7
    Join Date
    Dec 2007
    Posts
    863

    Default

    Hi Ishan,

    The model that you want to implement is a special case of the Rodriguez et al. (1994) growth model, where the deformation gradient is decomposed into an elastic deformation and a growth tensor. This is a popular growth model that we haven't yet implemented in FEBio but we should. I'll spend a little time to work on a plugin that implements the general form of this growth model, and I'll make it sufficiently flexible so that users can select a variety of constitutive models for the growth evolution. I'll let you know when it is done.

    Best,

    Gerard

  8. #8
    Join Date
    Apr 2019
    Location
    Graz, Austria
    Posts
    25

    Default

    Hello Gerard,

    Could you please tell me the approximate time this will take?

    Best Regards,
    Ishan Gupta

  9. #9
    Join Date
    Dec 2007
    Posts
    863

    Default

    Hi Ishan,

    The finite element implementation of the Rodriguez growth model is not trivial. The most challenging part is the evaluation of the elasticity tensor when the growth is strain- or stress-dependent. I need to review various literature papers to see how others have implemented it. I am doing this during my spare time so I cannot tell you for certain when it will be done, but I expect it will take a week or two.

    I have already implemented the growth model where the growth is prescribed (i.e., not a function of loading, but simply determined by user-defined load curves for volume, area and fiber growth). If you would like to take over the task from there, I can share the plugin files with you.

    Best,

    Gerard
    Last edited by ateshian; 10-13-2019 at 04:10 PM.

  10. #10
    Join Date
    Apr 2019
    Location
    Graz, Austria
    Posts
    25

    Default

    Hello Gerard,

    Thank you for the reply. Two weeks is not a problem since I'm going for a conference next week.

    Best Regards,
    Ishan Gupta

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •