https://mooseframework.inl.gov
GeochemistryUnitConverter.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 #include "MooseTypes.h"
13 
18 {
19 enum class GeochemistryUnit
20 {
22  MOLES,
23  MOLAL,
24  KG,
25  G,
26  MG,
27  UG,
32  CM3
33 };
34 
50 Real fromMoles(Real moles,
51  const GeochemistryUnit unit,
52  const std::string & species_name,
54 
72 Real toMoles(Real quantity,
73  const GeochemistryUnit unit,
74  const std::string & species_name,
76 
96  unsigned ind,
97  const std::string & name,
98  const std::vector<Real> & mol_weight,
99  const std::vector<Real> & mol_volume,
100  const std::vector<bool> & is_mineral);
101 }
const ModelGeochemicalDatabase mgd
Real toMoles(Real quantity, const GeochemistryUnit unit, const std::string &species_name, const ModelGeochemicalDatabase &mgd)
Calculates the amount of moles corresponding to "quantity" "unit"s of species name, OR calculates the molality corresponding to "quantity" "unit"s of species name, whichever is appropriate.
Real fromMoles(Real moles, const GeochemistryUnit unit, const std::string &species_name, const ModelGeochemicalDatabase &mgd)
Calculates the amount of "unit"s of species_name in 1 mole, OR in 1 molal, whichever is appropriate...
const std::string name
Definition: Setup.h:20
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Data structure to hold all relevant information from the database file.
Real conversionFactor(const GeochemistryUnit unit, unsigned ind, const std::string &name, const std::vector< Real > &mol_weight, const std::vector< Real > &mol_volume, const std::vector< bool > &is_mineral)
Calculates the number of "unit" in 1 mole of substance, OR calculates the number of "unit" in 1 molal...
Utilities to convert to and from mole units.