Skip to content

[ASIM-6798] Addition of porosity and por fluid material - #560

Merged
ArleyAllesCruz merged 2 commits into
masterfrom
fb-ASIM-6798-Modify-formation-properties-using-porosity
Oct 9, 2026
Merged

ArleyAllesCruz merged 2 commits into
masterfrom
fb-ASIM-6798-Modify-formation-properties-using-porosity

Conversation

@ArleyAllesCruz

@ArleyAllesCruz ArleyAllesCruz commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

Motivation

Improve the formation rock thermal properties by accounting for porosity. This PR adds the
attributes needed to describe a porous formation material in .alfacase files; the porosity
model itself is implemented on the ALFAsim side (see the companion PR in alfasim).

How it works

The porosity of a formation material follows Athy's law:

$$ φ(z) = φ_{0} · exp(−b · z) $$

  • φ₀: initial_porosity, the porosity at the surface [-]
  • b: compaction_coefficient [1/m]
  • z: TVD measured from the formation.

ALFAsim uses the porosity of each formation layer to mix the properties of the rock with the
properties of the fluid that fills its pores (pore_fluid_material), producing the effective
density, heat capacity and thermal conductivity of the layer.

Modifications

MaterialDescription: three new optional attributes:

  • initial_porosity: Scalar, category dimensionless, default 0.0 [-].
  • compaction_coefficient: Scalar, category per length, default 0.0 [1/m].
  • pore_fluid_material: str | None, default None. It is the name of a fluid material
    (MaterialType.Fluid) of the case, either a default ALFAsim material (e.g. Brine) or a
    user-defined one. As with other material references in the SDK (material, stagnant_fluid),
    the name is resolved by ALFAsim when the case is loaded, not by the SDK. When None, ALFAsim
    uses the default Brine.

MaterialType: new Formation = "formation" member. It represents a porous rock used in
formation layers and is the only type for which the three attributes above are used.

Units / docs

  • Added the per length category to CATEGORIES_USED_ON_DESCRIPTION so its unit list is
    generated and included in the MaterialDescription docs (together with dimensionless).

Generated files

  • schema.py: new attributes and 'formation' in the material_type enum.
  • MaterialDescription.txt and list_of_unit_for_per_length.txt.
  • The matching regression files under tests/alfacase/.

Tests

  • filled_case_descriptions.MATERIAL_DESCRIPTION now sets the new attributes to non-default
    values (initial_porosity=0.3, compaction_coefficient=0.0005 1/m, pore_fluid_material="Brine"),
    so the alfacase round-trip tests actually cover them. Since this fixture is shared with
    alfasim, tests there that use it need Brine in their material list (done in the
    companion PR).
  • test_material_description_as_dict updated with the new attributes.

Related Issue(s)

ASIM-6913 (originally ASIM-6798, which was closed by accident).

@ArleyAllesCruz
ArleyAllesCruz force-pushed the fb-ASIM-6798-Modify-formation-properties-using-porosity branch 2 times, most recently from b508bfe to 02b0ae9 Compare August 5, 2026 18:24
@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

@BeneBr

BeneBr commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

I believe that you need to rebase with master to update the pip requirements.txt to get the new pinned version of cog lib.

@ArleyAllesCruz
ArleyAllesCruz force-pushed the fb-ASIM-6798-Modify-formation-properties-using-porosity branch 2 times, most recently from edb21f9 to 5979111 Compare October 7, 2026 16:29
@ArleyAllesCruz
ArleyAllesCruz requested a review from BeneBr October 7, 2026 17:29
@ArleyAllesCruz
ArleyAllesCruz force-pushed the fb-ASIM-6798-Modify-formation-properties-using-porosity branch from 92bdb51 to 41bbe9c Compare October 9, 2026 08:32
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@ArleyAllesCruz
ArleyAllesCruz merged commit 6a47dd6 into master Oct 9, 2026
8 checks passed
@ArleyAllesCruz
ArleyAllesCruz deleted the fb-ASIM-6798-Modify-formation-properties-using-porosity branch October 9, 2026 11:04
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.

3 participants