@@ -99,7 +99,7 @@ bool CConstituentModel::IsPassive() const {
9999// / \param iToWater [in] index of "to" water storage state variable
100100// / \param Cs [in] RAW constituent concentration (mg/L or MJ/L or L/L, not mg/L or C or o/oo)
101101//
102- double CConstituentModel::GetAdvectionCorrection (const CHydroUnit* pHRU,const int iFromWater,const int iToWater,const double & Cs ) const
102+ double CConstituentModel::GetAdvectionCorrection (const CHydroUnit* pHRU,const int iFromWater,const int iToWater,const double & mass, const double &vol, const double &Q ) const
103103{
104104 /* sv_type fromType=_pModel->GetStateVarType(iFromWater);
105105 sv_type toType =_pModel->GetStateVarType(iToWater);
@@ -171,17 +171,18 @@ double CConstituentModel::GetCatchmentTransitLosses(const int p) const
171171bool CConstituentModel::IsDirichlet (const int i_stor,const int k,const time_struct &tt,double &Cs,const double blend) const
172172{
173173 Cs=0.0 ;
174+ double Cs2=0.0 ;
174175 int i_source=_aSourceIndices[i_stor][k];
175176 if (i_source==DOESNT_EXIST) { return false ; }
176177 if (!_pSources[i_source]->dirichlet ) { return false ; }
177- Cs = _pSources[i_source]->concentration ;
178- if (blend!=1.0 ){Cs=Cs*blend+(1 -blend)*_pSources[i_source]->concentration2 ;}
179178
180- if (Cs != DOESNT_EXIST) { return true ; }
181- else {// time series
182- Cs = _pSources[i_source]->pTS ->GetValue (tt.model_time );
183- return true ;
184- }
179+ Cs =_pSources[i_source]->concentration ;
180+ Cs2=_pSources[i_source]->concentration2 ;
181+ if (blend!=1.0 ){Cs=(blend)*Cs+(1 -blend)*Cs2; }
182+
183+ if (Cs == DOESNT_EXIST) {Cs = _pSources[i_source]->pTS ->GetValue (tt.model_time );}// time series
184+
185+ return true ;
185186}
186187// ////////////////////////////////////////////////////////////////
187188// / \brief returns specified mass flux for given constitutent and water storage unit at time tt
@@ -668,6 +669,13 @@ void GetUnitNames(constit_type type,bool writemass,string &kg,string &kgd,string
668669 }
669670}
670671// ////////////////////////////////////////////////////////////////
672+ // / \brief update initial conditions
673+ // / \details Called prior to simulation (but after initialization) from CModel::Initialize()
674+ //
675+ void CConstituentModel::UpdateInitialConditions (const optStruct& Options) {
676+ // default: does nothing
677+ }
678+ // ////////////////////////////////////////////////////////////////
671679// / \brief Write transport output file headers
672680// / \details Called prior to simulation (but after initialization) from CModel::Initialize()
673681// / \param &Options [in] Global model options information
@@ -1325,7 +1333,12 @@ void CConstituentModel::WriteMinorOutput(const optStruct &Options,const time_str
13251333
13261334 if (_pTransModel->GetStorWaterIndex (ii)!=iCumPrecip)
13271335 {
1328- _OUTPUT<<" ," <<concentration; // print column entry
1336+ if ((V < 1e-6 ) && (_type == ISOTOPE)) {
1337+ _OUTPUT<<" ," ;
1338+ }
1339+ else {
1340+ _OUTPUT<<" ," <<concentration; // print column entry
1341+ }
13291342 currentMass+=M*(area*M2_PER_KM2); // [mg] or [MJ] //increment total mass in system
13301343 }
13311344 else {
0 commit comments