kreft / iDynoMiCS

Individual-based Dynamics of Microbial Communities Simulator
Other
18 stars 37 forks source link

Per-species relative diffusivity #46

Open fophillips opened 10 years ago

fophillips commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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: