Closed WilkAndy closed 4 years ago
The "restore" should happen before doing the swaps. Then the user can choose a different basis to a previous solve - advantageous if they want to fix fugacity of a gas that was previously a secondary species, for instance.
Probably the "save" should mean that we need an AuxVariable for each species (basis, secondary, etc) and should save into an Exodus file. Then restore should happen via a SolutionUserObject, etc. I wonder whether an Action can add AuxVariables that specified by the GeochemicalModelDefinition
UserObject?
@andywilkins, I worry having AuxVariables for each species will become overly cumbersome without some overlying Action
-- Robert Podgorney, PhD, PG Geothermal Program Manager, Idaho National Laboratory Modeling and Simulation Lead, Utah FORGE Program Thermal Systems Co-Lead, INL Integrated Energy Systems Initiative
Office: 208-526-1524
From: Andy Wilkins notifications@github.com Reply-To: idaholab/moose reply@reply.github.com Date: Wednesday, May 20, 2020 at 11:59 PM To: idaholab/moose moose@noreply.github.com Cc: Robert Podgorney Robert.Podgorney@inl.gov, Mention mention@noreply.github.com Subject: [EXTERNAL] Re: [idaholab/moose] Geochemistry: add time-dependency (#15330)
Probably the "save" should mean that we need an AuxVariable for each species (basis, secondary, etc) and should save into an Exodus file. Then restore should happen via a SolutionUserObject, etc. I wonder whether an Action can add AuxVariables that specified by the GeochemicalModelDefinition UserObject?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fidaholab%2Fmoose%2Fissues%2F15330%23issuecomment-631898277&data=02%7C01%7Crobert.podgorney%40inl.gov%7Ca7b669a6b2f04a0c21e708d7fd4c15da%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C637256375531049055&sdata=FxmPYD3sN63xLBC7WpSKMW0zJiXyhEryehdJd8AZYJo%3D&reserved=0, or unsubscribehttps://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACWGDT43GZWX3INZALXFYULRSS7KZANCNFSM4NGRZOJA&data=02%7C01%7Crobert.podgorney%40inl.gov%7Ca7b669a6b2f04a0c21e708d7fd4c15da%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C637256375531049055&sdata=NGu2%2FJx3r62FDo5WS5wcyvLc%2FLRrFNQfDRpaCQ77ZCU%3D&reserved=0.
Yea, you're absolutely right. There are usually at least 10 primary species and probably 100 secondary species. We need an Action!
Another possibly solution could be array variable/auxkernel. You may have one single array variable for all 100 species.
Oh, can you give me an example, @YaqiWang ?
https://github.com/idaholab/moose/blob/next/test/tests/kernels/array_kernels/array_diffusion_reaction.i is a test using array kernels. When I added array variable capability, I was not in needs of aux array kernels, so I did not added (but can be added easily). The number of components of a array variable can be any number.
I like this approach, need to look a bit closer at the code
-- Robert Podgorney, PhD, PG Geothermal Program Manager, Idaho National Laboratory Modeling and Simulation Lead, Utah FORGE Program Thermal Systems Co-Lead, INL Integrated Energy Systems Initiative
Office: 208-526-1524
From: Yaqi notifications@github.com Reply-To: idaholab/moose reply@reply.github.com Date: Thursday, May 21, 2020 at 3:31 PM To: idaholab/moose moose@noreply.github.com Cc: Robert Podgorney Robert.Podgorney@inl.gov, Mention mention@noreply.github.com Subject: [EXTERNAL] Re: [idaholab/moose] Geochemistry: add time-dependency (#15330)
https://github.com/idaholab/moose/blob/next/test/tests/kernels/array_kernels/array_diffusion_reaction.ihttps://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fidaholab%2Fmoose%2Fblob%2Fnext%2Ftest%2Ftests%2Fkernels%2Farray_kernels%2Farray_diffusion_reaction.i&data=02%7C01%7Crobert.podgorney%40inl.gov%7C700b357615a4447c0fe108d7fdce57cf%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C637256934995833332&sdata=%2BE7TXvSxQrfvF8sUdxTqE%2B1Fzr4GQ%2B%2FP8k61iiJ4F1I%3D&reserved=0 is a test using array kernels. When I added array variable capability, I was not in needs of aux array kernels, so I did not added (but can be added easily). The number of components of a array variable can be any number.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fidaholab%2Fmoose%2Fissues%2F15330%23issuecomment-632357068&data=02%7C01%7Crobert.podgorney%40inl.gov%7C700b357615a4447c0fe108d7fdce57cf%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C637256934995843325&sdata=1W4l1N0mHIa2HhWLNP3rNN%2BwINDECYUFEI%2BDpNcUJnY%3D&reserved=0, or unsubscribehttps://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACWGDT2HHIS23DWODJUETJDRSWMTNANCNFSM4NGRZOJA&data=02%7C01%7Crobert.podgorney%40inl.gov%7C700b357615a4447c0fe108d7fdce57cf%7C4cf464b7869a42368da2a98566485554%7C0%7C0%7C637256934995843325&sdata=YHSkDqLtqlj4GXxfPQUHnaabw5G6td%2FaiJUSOTWOLAE%3D&reserved=0.
Cool, thanks @YaqiWang . I'll consider it. The disadvantage is that i won't know the names of the species, so will somehow have to record that. I'll have a think....
The "restore" should happen before doing the swaps. Then the user can choose a different basis to a previous solve - advantageous if they want to fix fugacity of a gas that was previously a secondary species, for instance.
Actually, i don't think this ordering of "restore" is necessary (or even desirable). The "restore" can happen at any time because it is just setting molalities. Just have to be careful with constraints
Woohoo, @rpodgorney and @cpgr, i just did my first time-dependent simulation and it all went really well.
https://mooseframework.org/modules/geochemistry/tests_and_examples/adding_feldspar.html
Lots of work to go, but the core machinery seems behave itself really nicely, so i'm quite pleased.
well done @WilkAndy!
OK, coding is basically done. Need to spend a few days tidying.
Reason
Need to be able to simulate equilibrium reactions with time-dependency
Design
Probably need to employ a NodalUserObject that uses coupledVars for temperature, etc, and does the initial solve in initialize() and subsequent solves in execute(). Whatever the design, here is some functionality that is required:
EquilibriumGeochemicalSystem
from "free_molality" to "bulk_moles" (and similar for minerals) EXCEPT for species with specified time-dependent activity and gases with specified time-dependent fugacity. This is so that we can add or remove chemicals from the system.EquilibriumGeochemicalSystem
should therefore be able to change the bulkMoles of species. However, any chemical in theMinimalGeochemicalDatabase
should be able to be added, not just the basis species, hence secondary species are decomposed into their basis components and these are added to the aqueous solution according to the stoichiometries (of course, if one of the basis components has fixed activity then its bulk composition is fixed by that, not by the addition of the chemicals). Probably best that the rates of these added chemicals be coupledVars, even though they probably won't be Variables (only AuxVariables).geochemistry
: the user can just defined a ParsedAux that's10^(-9+2*t)
or whatever.EquilibriumGeochemicalSystem
to save all molalities of the aqueous system (primary and secondary) into a fileEquilibriumGeochemicalSystem
to read this file to initialise molalities. The constraint meanings should be set by the user during this initialisation process. The constraint values should be either set by the file (eg, calculating bulk_moles from the molalities, or activity from the molalities) or set by the user (to do another simulation, for example). This is probably easily implemented by having another std::vectorImpact
Ability to model common time-dependent geochemical systems.
Notifying @rpodgorney and @cpgr