Skip to content

Commit

Permalink
implement the H2 coeff for the OH componet as something that can be r…
Browse files Browse the repository at this point in the history
…ead in from teh ini file
  • Loading branch information
kdorheim committed Nov 6, 2024
1 parent a46e14e commit ec1511f
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions inst/include/component_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@
#define D_COEFFICENT_CH4 "CCH4"
#define D_COEFFICENT_NMVOC "CNMVOC"
#define D_COEFFICENT_CO "CCO"
#define D_COEFFICENT_H2 "CH2"
#define D_EMISSIONS_H2 "H2_emissions"


Expand Down
2 changes: 2 additions & 0 deletions inst/include/oh_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ class OHComponent : public IModelComponent {
double CNMVOC; // coefficent for NMVOC
double CNOX; // coefficent for NOX
double CCH4; // coefficent for CH4
double CH2; // coefficent for CH4


// logger
Logger logger;
Expand Down
1 change: 1 addition & 0 deletions inst/input/hector_ssp119.ini
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ CNOX=0.0042 ; coefficent for NOX
CCO=-0.000105 ; coefficent for CO
CNMVOC=-0.000315 ; coefficent for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficent for CH4
CH2=-0.00044625 ; coefficent for H2

;------------------------------------------------------------------------
[ozone]
Expand Down
2 changes: 2 additions & 0 deletions inst/input/hector_ssp126.ini
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ CNOX=0.0042 ; coefficent for NOX
CCO=-0.000105 ; coefficent for CO
CNMVOC=-0.000315 ; coefficent for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficent for CH4
CH2=-0.00044625 ; coefficent for H2


;------------------------------------------------------------------------
[ozone]
Expand Down
2 changes: 2 additions & 0 deletions inst/input/hector_ssp245.ini
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ CNOX=0.0042 ; coefficent for NOX
CCO=-0.000105 ; coefficent for CO
CNMVOC=-0.000315 ; coefficent for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficent for CH4
CH2=-0.00044625 ; coefficent for H2


;------------------------------------------------------------------------
[ozone]
Expand Down
2 changes: 2 additions & 0 deletions inst/input/hector_ssp370.ini
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ CNOX=0.0042 ; coefficent for NOX
CCO=-0.000105 ; coefficent for CO
CNMVOC=-0.000315 ; coefficent for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficent for CH4
CH2=-0.00044625 ; coefficent for H2


;------------------------------------------------------------------------
[ozone]
Expand Down
2 changes: 2 additions & 0 deletions inst/input/hector_ssp434.ini
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ CNOX=0.0042 ; coefficent for NOX
CCO=-0.000105 ; coefficent for CO
CNMVOC=-0.000315 ; coefficent for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficent for CH4
CH2=-0.00044625 ; coefficent for H2


;------------------------------------------------------------------------
[ozone]
Expand Down
2 changes: 2 additions & 0 deletions inst/input/hector_ssp460.ini
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ CNOX=0.0042 ; coefficent for NOX
CCO=-0.000105 ; coefficent for CO
CNMVOC=-0.000315 ; coefficent for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficent for CH4
CH2=-0.00044625 ; coefficent for H2


;------------------------------------------------------------------------
[ozone]
Expand Down
2 changes: 2 additions & 0 deletions inst/input/hector_ssp534-over.ini
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ CNOX=0.0042 ; coefficent for NOX
CCO=-0.000105 ; coefficent for CO
CNMVOC=-0.000315 ; coefficent for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficent for CH4
CH2=-0.00044625 ; coefficent for H2


;------------------------------------------------------------------------
[ozone]
Expand Down
2 changes: 2 additions & 0 deletions inst/input/hector_ssp585.ini
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ CNOX=0.0042 ; coefficent for NOX
CCO=-0.000105 ; coefficent for CO
CNMVOC=-0.000315 ; coefficent for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficent for CH4
CH2=-0.00044625 ; coefficent for H2


;------------------------------------------------------------------------
[ozone]
Expand Down
5 changes: 4 additions & 1 deletion src/oh_component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ void OHComponent::setData(const string &varName, const message_data &data) {
} else if (varName == D_COEFFICENT_NOX) {
H_ASSERT(data.date == Core::undefinedIndex(), "date not allowed");
CNOX = data.getUnitval(U_UNDEFINED);
} else if (varName == D_COEFFICENT_H2) {
H_ASSERT(data.date == Core::undefinedIndex(), "date not allowed");
CH2 = data.getUnitval(U_UNDEFINED);
} else {
H_THROW("Unknown variable name while parsing " + getComponentName() +
": " + varName);
Expand Down Expand Up @@ -172,7 +175,7 @@ void OHComponent::run(const double runToDate) {
((1.0 * +current_nmvoc) -
NMVOC_emissions.get(NMVOC_emissions.firstdate()).value(U_TG_NMVOC));
const double e =
(-0.00044625) *
CH2 *
((1.0 * +current_h2) -
H2_emissions.get(H2_emissions.firstdate()).value(U_TG_H2));

Expand Down

0 comments on commit ec1511f

Please sign in to comment.