Skip to content

Diffusion coefficients are not preserved in the micm::Phase #616

@boulderdaze

Description

@boulderdaze

In the mechanism configuration, the PhaseSpecies struct is defined as below. micm::Phase stores species as a std::vectormicm::Species, instead std::vector<PhaseSpecies> and therefore, diffusion coefficient information for species in a given phase is not captured during the conversion from the mechanism configuration type to the micm type. This needs to be implemented.

From mechanism configuration

      struct PhaseSpecies
      {
        std::string name;
        std::optional<double> diffusion_coefficient;
        /// @brief Unknown properties, prefixed with two underscores (__)
        std::unordered_map<std::string, std::string> unknown_properties;
      };

      struct Phase
      {
        std::string name;
        std::vector<PhaseSpecies> species;
        /// @brief Unknown properties, prefixed with two underscores (__)
        std::unordered_map<std::string, std::string> unknown_properties;
      };

Ideas

  • Update the function in /src/micm/v1_parse.cpp once micm::Phase is updated micm issue #845
  std::vector<micm::Phase> convert_phases(
      const std::vector<mechanism_configuration::v1::types::Phase>& phases,
      std::unordered_map<std::string, micm::Species>& species_map)
  • Update the full configuration to remove the entry for diffusion coefficient (/config/v1/full_configuration)
{
  "version": "1.0.0",
  "name": "Full Configuration",
  "species": [
    {
      "name": "A",
      "molecular weight [kg mol-1]": 0.02897,
      "diffusion coefficient [m2 s-1]": 1.0e-05,   <---- HERE!
      "__absolute tolerance": 1.0e-30
    },
  • Update the configuration to add diffusion coefficient entry, and update the test
  "phases": [
    {
      "name": "gas",
      "species": [
        {"name": "A"},
        {"name": "B"},
        {"name": "C"},
        {
          "name": "ethanol",
          "diffusion coefficient [m2 s-1]": 2.1e-5
        },
        {
          "name": "H2O2",
          "diffusion coefficient [m2 s-1]": 2.1e-5
        }
      ]
    }
  ],

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions