Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spatial: DiffusionCoefficient should be handled analogously to AdvectionCoefficient. #383

Open
luciansmith opened this issue Jul 25, 2022 · 6 comments

Comments

@luciansmith
Copy link
Member

From @matthiaskoenig :
For me it seems strange that these two transport mechanisms are handled so differently! Both advection and diffusion are just special transport mechanisms. I can imagine other Transport mechanisms (e.g. due to active transport). I would probably simplify/generalize the Diffusion/Advection to something along the line of.

TransportCoeffiecient:
	variable: SIdRef
	type: TransportType[Diffusion, Advection]
	coord1: CoordinateKind {use=”optional”}
	coord2: CoordinateKind {use=”optional”}
	coord3: CoordinateKind {use=”optional”}

This would allow simple extension of transport types in the future or define other transport types easily (e.g. via annotation). E.g. we have transport due to tissue deformation/change in fractions in porous media which could be described with such TransportCoefficients. Also things such as active transport (e.g. along axin/myosin fibers, …) could be handled via such TransportCoefficients. I think limiting transport to advection and diffusion and hard coding these in the specification is the wrong approach and introduces unnecessary complexity.

Due to the introduction of the various diffusion types almost a complete page is required in the specification to explain all the cases and combinations (section 3.10.2 and 3.10.3). See in comparison the 6 lines in 3.11.2.

I also have the feeling that the presented cases of isotropic/tensor Diffusion only work for the CartesianCoordinates. Not clear what isotropic would mean in polar coordinates because it would likely result in non-isotropic diffusion applying the same Diffusion parameter on the polar axes (due to stretching of space). Having finer grained control of defining the transport parameter over the respective coordinates is probably much more robust in other coordinate systems.

@jcschaff
Copy link
Contributor

I suppose an example for diagonal and non-diagonal diffusion tensors would be helpful.

Note that in production, VCell uses only a scalar diffusion coefficient (flux = d grad(C) and only supports cartesian coordinates. I generalized spatial extension diffusion coefficient (a bit) in order to invite innovation from other spatial solver technologies where such support would be easy to add.

I'm pretty rusty with my multivariable calculus - but polar and spherical coordinates are orthogonal coordinate systems and I think the notion of a tensor is locally well described. Regarding isotropic diffusion, I thought that the different gradient and divergence operators in these coordinate systems make it all work out. ... okay, I don't actually know what I'm talking about ... I will not be offended if someone corrects me.

@jcschaff
Copy link
Contributor

... and I'm a tensor newbie (I started digging into continuum mechanics some years back, but only superficially).

@jcschaff
Copy link
Contributor

I would be personally interested in seeing how to generalize these notions for multiphase materials, different frames of reference, deformation and active transport - but that is well beyond the scope of sbml spatial. 6-7 years ago, we at VCell proposed an initial framework for describing some of these concepts (and a basic solver), combining cell mechanics with biochemical processes and imaging - but this work was never funded. I think with the help of modern FEM frameworks, rapid progress could be made.

@fbergmann
Copy link
Member

I would be in favor of leaving things as they are right now, and make any of these changes in a next version of spatial.

@luciansmith
Copy link
Member Author

I agree that this looks like a ripe avenue for improvement, but also think that since the current system works for everyone for now, we should push it to a future version of Spatial, perhaps after other types of diffusion are being implemented by simulators that find the spatial spec inadequate.

@matthiaskoenig
Copy link

Sounds good to me. I understand that such major changes will not be possible so late in the development of spatial. Covering diffusion (inhomogenous) and convection are the two main use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants