#include <Landuse.hpp>
|
| void | init (int n_landuses, int n_pollutants) |
| | Set solver counts and resize landuse/pollutant parameter tables.
|
| |
| void | computeBuildup (SurfaceQualitySoA &sq, const double *area, const double *curb_length, double dt, int n_subcatch) |
| | Batch compute buildup for all subcatchments.
|
| |
| void | computeWashoff (SurfaceQualitySoA &sq, const double *runoff, const double *area, int n_subcatch) |
| | Batch compute washoff for all subcatchments.
|
| |
| void | applyCoPollutant (SurfaceQualitySoA &sq, const double *runoff, const double *area, const int *co_pollut, const double *co_frac, int n_subcatch) |
| | Apply co-pollutant washoff fractions.
|
| |
◆ applyCoPollutant()
| void openswmm::landuse::LanduseSolver::applyCoPollutant |
( |
SurfaceQualitySoA & | sq, |
|
|
const double * | runoff, |
|
|
const double * | area, |
|
|
const int * | co_pollut, |
|
|
const double * | co_frac, |
|
|
int | n_subcatch ) |
Apply co-pollutant washoff fractions.
After primary washoff is computed, for each pollutant p with a co-pollutant k: washoff[p] += co_frac[p] * washoff[k]. Matches legacy landuse_getCoPollutLoad().
- Parameters
-
| sq | Surface quality SoA (washoff_conc modified in-place). |
| runoff | Runoff rate per subcatchment (for mass rate conversion). |
| area | Subcatchment area. |
| co_pollut | Co-pollutant index per pollutant (-1 = none). |
| co_frac | Co-pollutant fraction per pollutant. |
| n_subcatch | Number of subcatchments. |
runoff and area are unused in this concentration-only implementation and may be null. co_pollut/co_frac each cover n_pollutants_ when nonnull; either null returns. sq.washoff_conc covers n_subcatch*n_pollutants_ with nonnegative representable dimensions; indices outside pollutant range are skipped, nonpositive fractions skipped. Single forward pollutant pass sees earlier additions, including dependent/self references; it is not a simultaneous or cycle-checked solve. No unit conversion/generated-mass ledger, physical clock mutation or allocation. Exclusive state required; no general finite/sign validation of existing concentrations/fractions.
◆ computeBuildup()
| void openswmm::landuse::LanduseSolver::computeBuildup |
( |
SurfaceQualitySoA & | sq, |
|
|
const double * | area, |
|
|
const double * | curb_length, |
|
|
double | dt, |
|
|
int | n_subcatch ) |
Batch compute buildup for all subcatchments.
Advance the simplified analytic buildup table using landuse-zero parameters.
For each (subcatch, pollutant):
- Convert current buildup to equivalent days (inverse function)
- Add timestep: days += dt / 86400
- Recompute buildup mass (forward function) All three steps are vectorisable (pow/exp/division).
- Parameters
-
| [in] | area | Unused compatibility pointer, may be null; no normalization performed here. |
| [in] | curb_length | Unused compatibility pointer, may be null. |
- Note
- This helper currently uses only landuse-zero parameters and flat subcatchment/pollutant state indexing. The complete coverage-weighted accepted runoff operator is surfacespecies::step; source definition documents simplified behavior and nontransactional state updates.
- Parameters
-
| [in,out] | sq | Writable buildup covering n_subcatch*n_pollutants_ in this helper's flat [subcatch*n_pollutants_+pollutant] indexing, regardless of sq.n_landuses. Caller must account for this simplified layout rather than treating it as full landuse-weighted runtime kernel. |
| [in] | dt | Positive finite duration s, converted to days before inverse/forward curve update. |
| [in] | n_subcatch | Nonnegative number of flat subcatchment rows to update, covered by sq.buildup. |
- Note
- The two unnamed area/curb pointers in definition are intentionally unused and may be null. Requires buildup_params at least n_pollutants_ (normally n_landuses_>=1), qualified nonnegative counts/ int products and curve parameters. Skips NONE rows; EXTERNAL lacks a series operator here and analytic helpers return0. Updates progressively without dry/snow/coverage/sweeping or mass-ledger booking, no engine clock change. No allocation/general shape/finite validation or rollback.
◆ computeWashoff()
| void openswmm::landuse::LanduseSolver::computeWashoff |
( |
SurfaceQualitySoA & | sq, |
|
|
const double * | runoff, |
|
|
const double * | area, |
|
|
int | n_subcatch ) |
Batch compute washoff for all subcatchments.
Apply simplified landuse-zero washoff to flat subcatchment/pollutant arrays.
For each (subcatch, pollutant): EMC: conc = coeff (constant — trivially vectorisable) Exponential: conc = k * Q^n * B / (Q * A) (vectorisable) Rating: conc = k * (Q*A)^(n-1) (vectorisable)
- Parameters
-
| [in,out] | sq | Writable concentration/buildup covering n_subcatch*n_pollutants_, flat indexing independent of landuse dimension. Only selected row-zero parameters are read. |
| [in] | runoff | Readable n_subcatch runoff samples; treated as rate q in caller's coefficient convention (EXPON divides by q*area, RATING uses q*area). No internal/project unit conversion. |
| [in] | area | Readable n_subcatch positive area samples in compatible coefficient convention. |
| [in] | n_subcatch | Nonnegative count covered by both inputs and state arrays. |
- Note
- Requires washoff_params>=n_pollutants_. NONE retains old concentration. Nonpositive q/area sets concentration0. EMC gives coefficient, EXPON uses stored buildup, RATING power law, result floored0. EXPON debits conc*q*area directly without multiplying a timestep; no duration argument or full runoff-step mass/ledger contract is provided by this helper. No coverage/BMP/physical clock advance, allocation or general finite/shape validation; exclusive simplified state access.
◆ init()
| void openswmm::landuse::LanduseSolver::init |
( |
int | n_landuses, |
|
|
int | n_pollutants ) |
Set solver counts and resize landuse/pollutant parameter tables.
- Parameters
-
| [in] | n_landuses | Nonnegative count, product with pollutants fits int. |
| [in] | n_pollutants | Nonnegative native pollutant count. |
- Note
- resize retains overlapping old parameters, default-initializes added entries; this is not a full parameter reset. Dimension fields change before allocation, so failure can leave partial setup. No physical/native inventory/clock advance; exclusive setup ownership required.
◆ buildup_params
| std::vector<BuildupParams> openswmm::landuse::LanduseSolver::buildup_params |
Per (landuse × pollutant) parameters. Index: [lu * n_pollutants + p].
◆ n_landuses_
| int openswmm::landuse::LanduseSolver::n_landuses_ = 0 |
◆ n_pollutants_
| int openswmm::landuse::LanduseSolver::n_pollutants_ = 0 |
◆ washoff_params
| std::vector<WashoffParams> openswmm::landuse::LanduseSolver::washoff_params |
The documentation for this class was generated from the following files:
- /home/runner/work/openswmm.engine/openswmm.engine/src/engine/quality/Landuse.hpp
- /home/runner/work/openswmm.engine/openswmm.engine/src/engine/quality/Landuse.cpp