Skip to content

[Bug]: Cell‐centered slice at PBY=0.55 snaps to 0.60000002 instead of 0.55 #92

@ManuelOsburg

Description

@ManuelOsburg

What happened?

Description:
When requesting a cell‐centered slice at PBY=0.55 on a uniform 0.1 m grid, fdsreader returns y = [0.60000002] instead of 0.55. Even if ignore_cell_centered=True is passed to get_coordinates(), the result remains 0.60000002. The cell centers on a 0.1 m grid are at

0.05, 0.15, 0.25, 0.35, 0.45, 0.55, 0.65, 0.75, 0.85, 0.95

so a request for PBY=0.55 with CELL_CENTERED=T should locate that exact cell center at 0.55 m.

Steps to reproduce

Reproduction:

  1. Use a 1 m domain with 0.1 m grid spacing in y (nodal y: 0.0, 0.1, …, 1.0).
  2. In FDS input:
&SLCF PBY=0.50, QUANTITY='TEMPERATURE' /
&SLCF PBY=0.55, CELL_CENTERED=T, QUANTITY='TEMPERATURE' /
  1. In Python:
import fdsreader as fds
import os

sim = fds.Simulation(os.getcwd())

for slc in sim.slices:
    print(slc.cell_centered, slc.get_coordinates(ignore_cell_centered=False)["y"])

Output:

False  [0.5]
True   [0.60000002]
  1. Now call with ignore_cell_centered=True:
for slc in sim.slices:
    print(slc.cell_centered, slc.get_coordinates(ignore_cell_centered=True)["y"])

Output:

False  [0.5]
True   [0.60000002]

Expected Behavior:

  • For PBY=0.50, CELL_CENTERED=Falsey = [0.50].

  • For PBY=0.55, CELL_CENTERED=Truey = [0.55], because there is a cell center exactly at 0.55 m.

  • If ignore_cell_centered=True, then the slice should be treated as nodal (so nodal values exist at 0.0, 0.1, …, 1.0), but when CELL_CENTERED=True is present in the slice definition, the coordinates for that slice are still drawn from a pre‐shifted cell‐center array. In either case, a request for PBY=0.55 should not return 0.60000002.

Actual Behavior:

  • With ignore_cell_centered=False and CELL_CENTERED=False, y = [0.5].

  • With ignore_cell_centered=False and CELL_CENTERED=True, y = [0.60000002].

  • With ignore_cell_centered=True and CELL_CENTERED=True, y = [0.60000002].

In all cases where CELL_CENTERED=True and PBY=0.55, fdsreader returns 0.60000002 instead of 0.55.

test.zip

FDS version used

FDS-6.10.1-0-g12efa16-release

fdsreader version used

fdsreader, version 1.11.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions