Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jul 21 15:05

    gdmiron on v0.4.0

    (compare)

  • Jul 21 15:04

    gdmiron on v0.4.0

    (compare)

  • Jul 21 15:01

    gdmiron on master

    Fixes for macos build (#38) * … (compare)

  • Jul 21 15:01
    gdmiron closed #38
  • Jul 21 14:21
    gdmiron opened #38
  • Jul 18 12:19
    gdmiron commented #35
  • Jul 18 12:18
    gdmiron commented #34
  • Jul 18 12:16
    gdmiron commented #37
  • Jul 18 08:30
    gdmiron commented #37
  • Jul 18 07:10
    yurivict opened #37
  • Jul 18 07:09
    yurivict closed #36
  • Jul 18 07:09
    yurivict commented #36
  • Jul 18 06:45
    gdmiron commented #36
  • Jul 17 20:09
    yurivict edited #36
  • Jul 17 20:08
    yurivict opened #36
  • Jul 17 19:39
    yurivict edited #35
  • Jul 17 19:27
    yurivict edited #35
  • Jul 17 19:27
    yurivict opened #35
  • Jul 17 19:13
    yurivict opened #34
  • Jul 15 16:14

    gdmiron on v0.4.0

    (compare)

Robert Collar
@cardinalgeo
Hi all,
Thanks for the quick feedback!
@allanleal, in the json data file, I'm specifying the method as mv_pvnrt, which I had assumed indicated usage of the ideal gas law (though to be clear, I don't know what "mv" stands for at the beginning of the name). Is it a situation where this being a ThermoFun method means that it has no impact on how Reaktoro ultimately calculates gas properties? Also, I'm using MacOS.

@gdmiron, thanks for the clarification – it helps to see that the ideal gas law is used by ThermoFun to calculate standard state properties and then Reaktoro takes over from there with a real gas EOS. Unfortunately there are some gases without critical parameters in our database that are not available in the file you sent or the additional resource. The data in the example below were generated by a past student in out lab (Unitherm export format rather than json):

Pure phase: AuS(H2O)3,gas
G(298): -465446
S(298): 1080.467
V(298): 0.0000
Equations: 1
T(K): 1273.2
dVdT: 0.0000
dV: 0.0000
dH: 999999999
Max.terms: 3
0: -5.931557E+02
1: -8.434979E-02
-2: 2.394797E+07
Formula: AuS(H2O)3
Reference: fitfit

I guess my question boils down to this: can I "dumb it down" and, for those substances without critical parameters tabulated, specify that Reaktoro use the ideal gas law as an EOS at all P,T rather than model the gas using a cubic EOS (like PengRobinson, etc)?
George Dan Miron
@gdmiron
@allanleal maybe one could have an additional variant when no additional eos PV correction in used for gases, I think this is the same in the NASA database, where they have a Cp=f(T) only. 'mv' stands for molar volume, the code just does tps.volume = (t) / p * R_CONSTANT; and the temperature dependence is calculated based on the Cp=f(T) method.
Robert Collar
@cardinalgeo
Thanks for the clarification @D
  • @gdmiron. And I think your proposed would do the job!
**solution (I swear I can type!)
Robert Collar
@cardinalgeo

@gdmiron as a heads up, I recast the notebook documenting the heat capacity issue so that it'd be more readable. The previous links (pasted again below) should still work.

The notebook can be found here: https://github.com/cardinalgeo/hydrothermal-geochemistry-modeling/blob/main/Mo(s)_Cp_test.ipynb

and the the json datafile I use can be found here: https://github.com/cardinalgeo/hydrothermal-geochemistry-modeling/blob/main/databases/Mo(s).json

Allan Leal
@allanleal
@cardinalgeo you could use critical props of argon for the gases you want to behave like an ideal gas. For the acentric factor, set it to zero.
George Dan Miron
@gdmiron
@cardinalgeo there are some new updates (thermofun, reaktoro), hopefully fixing the Cp with phase transition and the formula parser. The bug in the formula parser was present only in the case of "split" elements formulas like FeFe¦3¦2O4 but not for H¦0¦2@. Thanks again for pointing out these issues.
Robert Collar
@cardinalgeo
Apologies for the delay! Thanks for the heads up @gdmiron – I'll update both. And no problem re: pointing out issues – I'm sorry that my C++ experience has been insufficient to contribute so far!
@allanleal – thanks for the suggestion; I think that'd be a great temporary solution; I'll look into it! However, filling in for missing data with data from another gas may prove confusing for future users of our database, and so, acknowledging that it takes more time to implement, I believe that a coded solution (i.e., use of the ideal gas law as EOS) would be ideal in the long-term. Furthermore, a coded solution could make Reaktoro a more pedagogically useful tool in the classroom, as it's common to introduce the ideal gas law as an EOS before introducing any of the cubic EOS.
George Dan Miron
@gdmiron
@cardinalgeo you contributions are extremely important. You are one of the first power users of ThermoFun and this will help bring it in a stable state!
Robert Collar
@cardinalgeo
@gdmiron I still am not sure how to use thermoParametersSubstance, which I previously brought up during the holidays (so no worries for not responding then!) Would you be able to provide a quick example or point me to code/documentation showing its use? I have yet to find any examples of its use in the GitHub repo or on the ThermoHub website.
Allan Leal
@allanleal
Guys, I produced a new version of Reaktoro in conda (v1.2.2) with the correction from Dan on converting molar mass units.
Robert Collar
@cardinalgeo
Great, thanks @allanleal and @gdmiron!
George Dan Miron
@gdmiron
@cardinalgeo we can discuss about what kind of functionality you need related to the thermoParametersSubstance, for example one could use the get and set functions for the parameters in a substance object to change their values, fit them.
Robert Collar
@cardinalgeo
I think I was barking up the wrong tree. Your suggestion re: get/set led me to the right place (for example, I've now used database.getSubstance('Mo').thermoParameters().Cp_coeff to get the coefficients for the heat capacity polynomial corresponding to the substance with symbol 'Mo'). Problem resolved!
Robert Collar
@cardinalgeo
Hi all! I’ve noticed an issue with Reaktoro parsing ThermoFun’s “slop98-inorganic” data file (pulled from the ThermoHub database client. Reaktoro seems to get hung up on the “type” of one of the Hg species, but nothing looks out of the ordinary in the slop98-thermofun.json in the GitHub repo: https://github.com/thermohub/thermofun/blob/master/Resources/databases/slop98-thermofun.json
Robert Collar
@cardinalgeo
(Note: the link takes you to a google colab jupyter notebook, which can be run in your browser. I thought this might streamline troubleshooting, though it does require that you have a google email account. Let me know if you encounter any issues or would prefer a different way of sharing the code!)
George Dan Miron
@gdmiron
I see, there is no option for transferring "liquid" species from tfun to reaktoro
           if(type == ThermoFun::AggregateState::type::AQUEOUS)
            {
                AqueousSpecies species = getAqueousSpecies(substance);
                if(valid(species))
                    aqueous_species_map[species.name()] = species;
            } else if(type == ThermoFun::AggregateState::type::GAS)
            {
                GaseousSpecies species = getGaseousSpecies(substance);
                if(valid(species))
                    gaseous_species_map[species.name()] = species;
            } else if(type == ThermoFun::AggregateState::type::CRYSTAL)
            {
                MineralSpecies species = getMineralSpecies(substance);
                if(valid(species))
                    mineral_species_map[species.name()] = species;

            } else RuntimeError("Could not parse the species `" + name + " in the database.",
                "The type of the species is unknown.");
        }
and Hg has "aggregate_state": ⊖{ "1": "AS_LIQUID" },
Allan Leal
@allanleal
If you don't need the liquid species, I would suggest deleting them from the database (if this is easy enough). In Reaktoro v2.0 (I'm working on the preparation of an initial release), there is improved support to accommodate all types of species. It would be better to resolve the issue there at a later time.
Robert Collar
@cardinalgeo
I certainly don’t need liquid Hg, but I can’t make any changes as I’m using the cloud-accessed (database client) version of the data file. @gdmiron would it be better to temporarily remove liquid Hg or to not tamper with it?
Allan Leal
@allanleal
Maybe there is a way of doing this programmatically if ThermoFun databases can filter out certain species.
George Dan Miron
@gdmiron
I am preparing an example to filter :)
Allan Leal
@allanleal
db = ThermoFun.Database("file.json")

db.removeif(lambda species: species.type() == "Liquid")
Something like this would be cool! Not necessarily identical, but you get the idea! :)
George Dan Miron
@gdmiron
Thanks Allan, I will keep this in mined to add to thermofun. For now one can filter in ThermoHubClient like:
subst = dbc.substancesInThermoDataSet("slop98-inorganic")
subst1 = [s[1:-1] for s in subst] # string fix  
subst2 = [s for s in subst1 if s not in ['Hg']]
dbc.saveDatabaseSubset(thermodataset="slop98-inorganic", 
                       elements=[],
                       substances=subst2,
                       classesOfSubstance=[],
                       aggregateStates=[])
Robert Collar
@cardinalgeo
Great, thanks! I’ll give it a shot
George Dan Miron
@gdmiron
Maybe it does not look very nice but I tried to come up with a solution :)
Robert Collar
@cardinalgeo
Hey @gdmiron! I proposed a change to the mines-16 data file on github (the pyrrhotite entry was missing phase transition info). If it seems reasonable, would you mind approving the change? I'd like to demonstrate pulling the mines-16 data file from the cloud in a workshop I'm putting on later this week, and the missing pyrrhotite info is causing a few problems.
George Dan Miron
@gdmiron
Hi @cardinalgeo I missed your message. Please write me an email if something is urgent like this
George Dan Miron
@gdmiron
I updated the pyrrhotite data
George Dan Miron
@gdmiron
Again, you gave me a great idea on how to maintain a mirror of thermohub on github so people like you can suggest fixes.
Robert Collar
@cardinalgeo
Awesome, that sounds great!
Robert Collar
@cardinalgeo
Hi @gdmiron! Something strange is happening with molar mass in ThermoFun (the code snippet below produces a value on the order of 10^-300). Would you mind taking a look?
import thermofun as fun 
import thermohubclient as client 
dbc = client.DatabaseClient()
dbc.saveDatabase("mines16")
# create database object from data file
database = fun.Database('./mines16-thermofun.json') 
print(database.getSubstance('H+').molarMass())
George Dan Miron
@gdmiron
Hi @cardinalgeo the molar mass is not present in the mines16-thermofun.json (this is not a problem for the connection with reaktoro where this is calculated from the substance formula) I will add it to the database client query. This summer I plan to expand the ThermoDataSets available in ThermoHub but for may datasets/databases I cannot guarantee that they will have "complete" data.
Robert Collar
@cardinalgeo
Thanks for the clarification! That’s good to hear :)
George Dan Miron
@gdmiron
tbh I don't remember why I commented out the molar mass from being exported to the saved database file // mass_per_mole: s.properties.mass_per_mole :)
George Dan Miron
@gdmiron
@cardinalgeo thermohubclient v0.2.1 now retrieves the molar mass
Robert Collar
@cardinalgeo
Awesome, thanks @gdmiron!
Robert Collar
@cardinalgeo
Hi all! What is the best way to suppress this output when building a database object? I can provide a brief example if that's easier. (Note that I'm working in Python rather than C++)
Allan Leal
@allanleal
I've also encountered this warning yesterday, Dan, with the reakt-granite files you sent me.
George Dan Miron
@gdmiron
Hi all, yes this can be annoying. This and other places should be replaced with a log file.
Robert Collar
@cardinalgeo
Hey @gdmiron, what would be required to replace spots like this with a log file, as you mentioned above?
George Dan Miron
@gdmiron
Hi @cardinalgeo a logger is in the works since a week (all output of that sort will be in a log file), hopefully the update will be available next week.
Robert Collar
@cardinalgeo
Amazing, thanks!
George Dan Miron
@gdmiron
@cardinalgeo with a bit of delay thermofun now logs warning, error and other messages to file: https://github.com/thermohub/thermofun/releases (In short time this should be on conda as well)