Skip to content

Create manure only simulation type - #3217

Open
matthew7838 wants to merge 4 commits into
devfrom
manure-only
Open

Create manure only simulation type#3217
matthew7838 wants to merge 4 commits into
devfrom
manure-only

Conversation

@matthew7838

Copy link
Copy Markdown
Collaborator

Adds a manure_only simulation type so the Manure Module can be run on its own.

Context

Issue(s) closed by this pull request: closes #2896

What

  • Adds SimulationType.MANURE_ONLY and its daily routine.
  • Adds DailyManureSupplier, which builds the daily manure streams from user input instead of from pens.
  • Adds an optional input describing the manure streams that enter the manure system each day.
  • Adds a manure_only example scenario, registered as the sixth task in available_simulation_tasks.json.

Why

The Manure Module could not be run by itself. Without the Animal Module nothing puts manure into the system, so every processor would sit empty for the whole simulation. Issue #2896 notes that a way of adding manure to the module throughout the year has to be defined before a manure-only scenario is possible.

How

The manure module already sets itself up from the existing manure_management and manure_processor_connection inputs, so the only missing piece was the manure supply. That supply is now stated directly as an input, following the same approach as the existing FieldManureSupplier stand-in on the manure to field boundary.

Each entry in daily_manure_streams describes one stream: its first processor, the animals producing it, and the masses it carries per day. DailyManureSupplier validates the entries once at start-up and then rebuilds fresh ManureStream objects every simulated day, because processors consume and mutate the streams they receive. Water is the difference between total manure mass and total solids, and volume is derived from the slurry manure density, matching how Pen builds a stream.

Start-up validation rejects a parlor stream that is not from lactating cows and a stream whose total solids exceed its total manure mass, and warns on duplicate stream names.

Note for reviewers: the values in the example supply file are placeholders written by hand, not taken from measurements or from an Animal Module run. Checked against the freestall e2e manure results, the bulk quantities are close (total solids 0.98x, nitrogen 1.08x) but the volatile solids split is off (degradable 0.49x, non-degradable 2.74x), which matters for storage methane. These should be replaced with SME-reviewed values, or values lifted from an animals_only run, before merging.

Test plan

  • New unit tests: five for DailyManureSupplier and three for the simulation engine. Existing simulation type tests updated for the new type.
  • Full unit suite: 7112 passed.
  • The manure_only example scenario runs seven simulated years with 0 errors.
  • An instrumented two-year run confirms manure actually flows through the system: the lactating slurry storage fills at about 6.5 t/day, empties on its 120 day schedule, and compost empties yearly.
  • Re-ran all six example scenarios (five existing plus the new one): 0 errors each, no regressions.
  • Confirmed that a supply file omitting the optional fields validates and runs on the metadata defaults.
  • flake8 and Black clean. Mypy error count matches the dev baseline (1139).

Input Changes

Added:

  • daily_manure_supply_properties: a new optional input describing the manure streams entering the manure system each day. Only read when manure is simulated without animals.
  • manure_only added to the simulation_type pattern in config_properties.
  • Example scenario files: example_manure_only_config.json, example_manure_only_daily_manure_supply.json, example_manure_only_metadata.json, and example_manure_only_task.json.
  • available_simulation_tasks.json registers the new manure_only task.

No existing input files or schemas were changed.

Output Changes

  • N/A

Existing scenarios are unaffected. The new scenario reports the usual Manure Module variables.

Filter

N/A

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on manure-only branch: 1134
Mypy errors on dev branch: 1134
No difference in error counts

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

Current Coverage: 99%

Mypy errors on manure-only branch: 1134
Mypy errors on dev branch: 1134
No difference in error counts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Manure Module Only Scenario

1 participant