amanzi / ats

Advanced Terrestrial Simulator (ATS) development
Other
47 stars 35 forks source link

ATS transport PK is grossly overusing memory #127

Open ecoon opened 2 years ago

ecoon commented 2 years ago

There are conceptual issues related to the number of each type of components.

Quantities such as conserved_qty and solid_residue are allocated with num_components, which is almost certainly not right, as it should at most be num_primary (which doesn't exist). It isn't obvious to me why transport is aware of secondaries at all.

Fix confusion over each type. Note fixing this should happen at the same time as #93

smolins commented 10 months ago

Primary and secondary is a Chemistry PK concept.

Transport should simply use components. Some are mobile, some are immobile as requested by #93 (and #149), all aqueous. (However, this may be confusing with Alquimia because Alquimia total_mobile means total aqueous and total immobile means sorbed, i.e. non-aqueous).

An additional problem is the use of num_aqueous (in addition to num_gaseous) due to the way gas diffusion was implemented in Amanzi.

Plus there is also num_advect on top of that, which is equal to num_aqueous (gases are not advected, only diffused).

It gets a bit even more confusing than that, because InitializeAll_ seems to be able to read "number of aqueous components advected" separately. I have never seen a single input file use this option.

But this does not have to do with overusing memory, so may need a separate issue.