Source: https://guthlabs.ai/docs/instruments/porosity-calculator/mechanism/

instrument mechanism / verified-clean

# Porosity Calculator mechanism

The inspectable method record for Porosity Calculator, kept separate from implementation and qualification.

Status: **VERIFIED_CLEAN**Lifecycle: **verified-clean**

## Model scope

The density relationship is standard for particle and bulk density, but the specification is not correct as written for a percentage output because it omits the ×100 conversion. The instrument should label whether it returns the fraction n or porosity in percent. The grain-density reference table must identify mineral assumptions and units; a single typical value is not valid for all rocks and soils.

- The density formula n = 1 - (ρ_bulk/ρ_grain) returns porosity as a dimensionless fraction, but the stated output is porosity (%); the implementation must multiply by 100 for a percentage.

- The two formulas use inconsistent output conventions: the volume formula explicitly multiplies by 100, while the density formula does not.

- The density formula requires positive densities and 0 < ρ_bulk <= ρ_grain for physically valid porosity between 0% and 100%; these constraints are not stated.

## Units and conventions

- Bulk and grain densities must use the same mass and volume units before taking their ratio, such as both in g/cm³ or both in kg/m³.

- Void volume and total volume must use the same volume units.

- Porosity is reported as a percentage from 0% to 100%; the intermediate n is a fraction from 0 to 1.

- Reference grain densities depend on mineral composition; a quartz value of 2.65 g/cm³ is an assumption, not a universal rock or soil grain density.

## Inspectable vector

One of 4 source-bound review vectors:

````
{
  "inputs": {
    "method": "density",
    "bulk_density": 1.6,
    "bulk_density_unit": "g/cm³",
    "grain_density": 2.65,
    "grain_density_unit": "g/cm³"
  },
  "expected_outputs": {
    "porosity_percent": 39.62264151
  },
  "working": "n = 1 - (ρ_bulk/ρ_grain) = 1 - (1.60/2.65) = 1 - (160/265) = 1 - (32/53) = 21/53 = 0.3962264151. Porosity = 0.3962264151 × 100 = 39.62264151%."
}
````

## Failure boundary

**BREAK_CLAIMED** · SELF_FLAGGED

The grain-density-zero input produces an undefined division, so the instrument must reject it. The specification does not state input validation behavior; a plain arithmetic implementation could emit Infinity or -Infinity instead of an explicit error.

## Other records

[01**Overview**](<https://guthlabs.ai/docs/instruments/porosity-calculator/>)[03**Implementation**](<https://guthlabs.ai/docs/instruments/porosity-calculator/implementation/>)[04**Qualification**](<https://guthlabs.ai/docs/instruments/porosity-calculator/qualification/>)

## Sources and evidence

These pointers bind the page to evidence. They do not grant authority or collapse verification into deployment.

- `VERIFIED_LEDGER.json`

- `evidence-tranche5/tranche5-results.json`

- `BOUNDARY_HAZARD_CATALOG.json`
