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

Per-species relative diffusivity #46

Open
fophillips opened this issue Nov 24, 2013 · 2 comments
Open

Per-species relative diffusivity #46

fophillips opened this issue Nov 24, 2013 · 2 comments

Comments

@fophillips
Copy link
Contributor

Currently iDynoMiCS allows the user to specify the diffusivity of a solute in water, and the relative diffusivity of a solute in the biofilm compared to water. For the project I am working on, it would be useful to be able to specify the relative diffusivity compared with water on a per-species basis (my investigation centres on how one species may inhibit another's access to solute), is this a feature that has been considered for iDynoMiCS, and if I implement it is it a wanted feature, i.e. will a pull request be considered?

As far as I can tell, this would mean changing Domain._biomassGrid and Domain._biofilmDiffusivity to arrays with an element for each species, and then Domain.calculateComputationDomainGrids will fetch the appropriate diffusivity for that species and map it onto _diffusivityGrid.

Thanks,
Fred Phillips
Edinburgh

@roughhawkbit
Copy link
Collaborator

Hi Fred,

I can't see this being difficult to implement, and so long as it's clear to the user what's going on then personally I have no problem with it being merged with the code. As far as I understand, the biofilm diffusivity is the same as in the bulk unless specified in the protocol, and the same thinking should apply here: the user should have to deliberately override the default settings to change individual relative diffusivities.

Whether or not it makes sense physically, I'm not the person to ask!

Regards,
Rob Clegg
Birmingham

@fophillips
Copy link
Contributor Author

So, I've been working on this a little bit here. I've used the fact that AgentContainer already had a biomass concentration grid for each species called _speciesGrid. I have made this public (speciesGrid) and extracted the method fitSpeciesMassOnGrids from writeGrids to call it separately.

Now Domain.calculateComputationDomainGrids checks if the species has a diffusivity as defined by an optional param in the species markup and adds uses that diffusion coefficient instead.

A couple of problems so far:

  • If there is more than one species present in a grid cell the behaviour is undefined: it could pick either coefficient depending on the order of the species. This could be fixed by calculated the mass ratio of each species and applying a weighted average to the diffusion coefficient, but I'm not sure how realistic/desirable that is.
  • calculateComputationDomainGrids now depends on currentSim.agentGrid to identify each species. This is fine once the simulation has been set up, but since introduction of self-attachment the Domain constructor calls calculateComputationDomainGrids before the agent grid object has been created.

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

No branches or pull requests

2 participants