abarret / clotting_model

An IBAMR implementation of Fogelson and Guy, 2008
2 stars 0 forks source link

Add IB structure #3

Closed abarret closed 2 years ago

abarret commented 2 years ago

This sets up flow past a confined cylinder. This code runs, but parameters need to be tuned so that it doesn't crash.

@jmcragun, take a look at this. This sets up an immersed structure using the IBFE method, which follows the same principles as the traditional IB method, but is based on a solid mechanics formulation of deformations.

This will form the basis of a test problem to model growth. We can start with a stationary cylinder, then start moving the cylinder.

jmcragun commented 2 years ago

Great! Funnily enough, I was just learning a little bit about how finite element methods are used to simulate deformations in my CG class. The reaction equations (4.20-22) still need to be implemented though, correct? If so, where does that typically get defined? After the break, I'm afraid I've gone and lost myself a bit. Can I template those classes after the stress tensor code we wrote?

abarret commented 2 years ago

Take a look at the branch add_platelet_sources. It contains a skeleton for adding source terms. You'll want to evaluate the platelet source values in setDataOnPatchLevel() just like with the stress tensor.

The platelet source is done in a slightly different way than the stress tensor code in that the other advected quantities are set by the variable and context pairs, instead of the path data index.

https://github.com/abarret/clotting_model/tree/add_platelet_sources

jmcragun commented 2 years ago

Thanks. How can I learn more about variable and context pairs? Specifically in terms of evaluating systems of equations. For example do we expect at this point to have things like gradient & laplacian of phi or R(c) available and it's a matter of plugging it into the equation, or is it the other way around with me computing those values and the application of those values to the equation is taken care of elsewhere? If that makes sense.

abarret commented 2 years ago

The way to think about variable and context pairs is that Variable represents the variable (phi, c, etc.) while VariableContext represents the time point, (getCurrentContext is timestep n, getNewContext is timestep n+1).

The idea in that template is that phi_n, phi_a, and c are all registered with the advection diffusion integrator. So we need the advection diffusion's current/new context, plus the variables themselves to get the patch data index. This is what's done in setDataOnPatchHierarchy. Then, inside of setDataOnPatch, we need to evaluate the reaction components of the PDE, and fill them in the patch data index data_idx. The advection diffusion solver already knows how to compute the gradient and Laplacian, it just needs to know how to compute the reaction terms.

jmcragun commented 2 years ago

Evidently we take R(c) to be R_0 *H(c - c_t) with R_0 and c_t being constants and H() being a "smoothed Heaviside" function. Do you know the definition of the kind of smooth Heaviside function we typically use?

jmcragun commented 2 years ago

To add, it is mentioned that typically phi_n and c is solved analytically between timesteps (by assuming R(c) to be constant between steps)? Is that what we will be doing as well? And finally, are we considering R^w(w), the wall-site reaction rate, in this version?

abarret commented 2 years ago

I'm going to go ahead and merge this, as it seems to be doing what we want it to.