55 provided in the top-level COPYRIGHT file.
66
77 Authors: Ahmad Jan (jana@ornl.gov)
8+ Bo Gao (gaob@ornl.gov)
89*/
910
1011/*
1819namespace Amanzi {
1920namespace Relations {
2021
21-
2222CarbonDecomposeRateEvaluator::CarbonDecomposeRateEvaluator (Teuchos::ParameterList& plist)
2323 : EvaluatorSecondaryMonotypeCV(plist)
2424{
@@ -44,6 +44,9 @@ CarbonDecomposeRateEvaluator::CarbonDecomposeRateEvaluator(Teuchos::ParameterLis
4444 depth_key_ = Keys::readKey (plist, domain_, " depth" , " depth" );
4545 dependencies_.insert (KeyTag{ depth_key_, tag });
4646
47+ subsidence_key_ = Keys::readKey (plist, domain_surf_, " subsidence" , " subsidence" );
48+ dependencies_.insert (KeyTag{ subsidence_key_, tag });
49+
4750 q10_ = plist_.get <double >(" Q10 [-]" , 2.0 );
4851
4952 is_func_temp_ = plist_.get <bool >(" use temperature dependent coefficient" , true );
@@ -75,6 +78,7 @@ CarbonDecomposeRateEvaluator::Evaluate_(const State& S, const std::vector<Compos
7578 const auto & depth_c = *S.Get <CompositeVector>(depth_key_, tag).ViewComponent (" cell" , false );
7679 const auto & sat_liq_c = *S.Get <CompositeVector>(sat_liq_key_, tag).ViewComponent (" cell" , false );
7780 const auto & sat_gas_c = *S.Get <CompositeVector>(sat_gas_key_, tag).ViewComponent (" cell" , false );
81+ const auto & subsidence_c = *S.Get <CompositeVector>(subsidence_key_, tag).ViewComponent (" cell" , false );
7882
7983 const auto & mesh = *S.GetMesh (domain_);
8084 const auto & mesh_surf = *S.GetMesh (domain_surf_);
@@ -86,7 +90,7 @@ CarbonDecomposeRateEvaluator::Evaluate_(const State& S, const std::vector<Compos
8690 if (temp_c[0 ][col_cells[c]] >= threshold_temp) {
8791 double dz = mesh.getCellVolume (col_cells[c]) / mesh_surf.getCellVolume (col);
8892 double f_temp = is_func_temp_ ? Func_Temp (temp_c[0 ][col_cells[c]], q10_) : 1 .;
89- double f_depth = is_func_depth_ ? Func_Depth (depth_c[0 ][col_cells[c]]) : 1 .;
93+ double f_depth = is_func_depth_ ? Func_Depth (depth_c[0 ][col_cells[c]] + subsidence_c[ 0 ][col] ) : 1 .;
9094 double f_pres = is_func_pres_ ? Func_Pres (pres_c[0 ][col_cells[c]]) : 1 .;
9195 double f_liq = is_func_liq_ ? Func_Satliq (sat_liq_c[0 ][col_cells[c]]) : 1 .;
9296 double f_gas = is_func_gas_ ? Func_Satgas (sat_gas_c[0 ][col_cells[c]]) : 1 .;
@@ -99,6 +103,26 @@ CarbonDecomposeRateEvaluator::Evaluate_(const State& S, const std::vector<Compos
99103}
100104
101105
106+ void
107+ CarbonDecomposeRateEvaluator::EnsureCompatibility_ToDeps_ (State& S)
108+ {
109+ const auto & fac = S.Require <CompositeVector, CompositeVectorSpace>(my_keys_.front ().first ,
110+ my_keys_.front ().second );
111+ if (fac.Mesh () != Teuchos::null) {
112+ for (const auto & dep : dependencies_) {
113+ if (Keys::getDomain (dep.first ) == Keys::getDomain (my_keys_.front ().first )) {
114+ S.Require <CompositeVector, CompositeVectorSpace>(dep.first , dep.second ).Update (fac);
115+ } else {
116+ CompositeVectorSpace dep_fac;
117+ dep_fac.SetMesh (S.GetMesh (Keys::getDomain (dep.first )))
118+ ->AddComponent (" cell" , AmanziMesh::Entity_kind::CELL, 1 );
119+ S.Require <CompositeVector, CompositeVectorSpace>(dep.first , dep.second ).Update (dep_fac);
120+ }
121+ }
122+ }
123+ }
124+
125+
102126double
103127CarbonDecomposeRateEvaluator::Func_Temp (double temp, double q10) const
104128{
0 commit comments