Skip to content

BoundaryData class doesn't read points file properly #37

@rthedin

Description

@rthedin

When reading boundary data, the points file isn't always read correctly and thus it stops at an assertion. The function that reads the points file has this comment:
https://github.com/NREL/windtools/blob/f18bbc11f7e883104443f7e8ffd6a7b519e073ad/windtools/SOWFA6/constant/boundaryData.py#L147-L149
but it does make assumptions on the ordering. In this function, the user can specify the number of points in the two directions and the code assumes certain order by doing
https://github.com/NREL/windtools/blob/f18bbc11f7e883104443f7e8ffd6a7b519e073ad/windtools/SOWFA6/constant/boundaryData.py#L158

If the user doesn't pass the number of points-- or rather, the points are in fact scrambled and the reshape above is not desirable-- it assumes one of the dimensions is varying faster in an ordered manner:
https://github.com/NREL/windtools/blob/f18bbc11f7e883104443f7e8ffd6a7b519e073ad/windtools/SOWFA6/constant/boundaryData.py#L159-L161

or,

https://github.com/NREL/windtools/blob/f18bbc11f7e883104443f7e8ffd6a7b519e073ad/windtools/SOWFA6/constant/boundaryData.py#L166-L168

The issue is that it assumes that the slow-varying dimension is ordered. The number of points in the slow-varying dimension, obtained with, for example, NY = np.nonzero(zlist > zlist[0])[0][0] only gives the correct number of points in that dimension when zlist is equal to np.sort(zlist). The re-ordering index obtained by reading points need to be carried forward and used when reading the actual files U, T,`k', etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions