Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regarding FAST_reader.py #259

Open
iman-tepsco opened this issue Aug 24, 2023 · 3 comments
Open

regarding FAST_reader.py #259

iman-tepsco opened this issue Aug 24, 2023 · 3 comments
Assignees

Comments

@iman-tepsco
Copy link

I have two questions regarding FAST_reader.py.

If the platform has more than one body, say two, and the model incorporates coupling between the bodies, the values for NBody and NBodyMod in HydroDyn will be two and one, respectively. In this scenario, AddF0 is a 12X1 vector (rather than a 6X1), while AddCLin, AddBLin, and AddBQuad are 12X12 matrices (rather than 6X6).
The dimensions of AddF0 are correctly understood by FAST_reader.py, but it appears to fall short of recognizing the dimensions of AddCLin, AddBLin, and AddBQuad, which may result in an error for such platforms.

According to lines no. 1684-1693 of FAST_reader.py:

`

    if self.fst_vt['HydroDyn']['NBodyMod'] == 1:
        self.fst_vt['HydroDyn']['AddF0']         = [float(f.readline().strip().split()[0]) for i in range(6*NBody)]
    elif self.fst_vt['HydroDyn']['NBodyMod'] > 1:
        self.fst_vt['HydroDyn']['AddF0']         = [[float(idx) for idx in f.readline().strip().split()[:NBody]] for i in range(6)]
    else:
        raise Exception("Invalid value for fst_vt['HydroDyn']['NBodyMod']")

    self.fst_vt['HydroDyn']['AddCLin']       = np.array([[float(idx) for idx in f.readline().strip().split()[:6]] for i in range(6)])
    self.fst_vt['HydroDyn']['AddBLin']       = np.array([[float(idx) for idx in f.readline().strip().split()[:6]] for i in range(6)])
    self.fst_vt['HydroDyn']['AddBQuad']      = np.array([[float(idx) for idx in f.readline().strip().split()[:6]] for i in range(6)])`

I believe the issue is resolved if it is changed to the following:

`

    if self.fst_vt['HydroDyn']['NBodyMod'] == 1:
        self.fst_vt['HydroDyn']['AddF0']         = [float(f.readline().strip().split()[0]) for i in range(6*NBody)]
        self.fst_vt['HydroDyn']['AddCLin']       = np.array([[float(idx) for idx in f.readline().strip().split()[:6*NBody]] for i in range(6*NBody)])
        self.fst_vt['HydroDyn']['AddBLin']       = np.array([[float(idx) for idx in f.readline().strip().split()[:6*NBody]] for i in range(6*NBody)])
        self.fst_vt['HydroDyn']['AddBQuad']      = np.array([[float(idx) for idx in f.readline().strip().split()[:6*NBody]] for i in range(6*NBody)])
    elif self.fst_vt['HydroDyn']['NBodyMod'] > 1:
        self.fst_vt['HydroDyn']['AddF0']         = [[float(idx) for idx in f.readline().strip().split()[:NBody]] for i in range(6)]
        self.fst_vt['HydroDyn']['AddCLin']       = np.array([[float(idx) for idx in f.readline().strip().split()[:6]] for i in range(6)])
        self.fst_vt['HydroDyn']['AddBLin']       = np.array([[float(idx) for idx in f.readline().strip().split()[:6]] for i in range(6)])
        self.fst_vt['HydroDyn']['AddBQuad']      = np.array([[float(idx) for idx in f.readline().strip().split()[:6]] for i in range(6)])
    else:
        raise Exception("Invalid value for fst_vt['HydroDyn']['NBodyMod']")`

Based on the foregoing, I have the following questions:

  1. Is my comprehension correct?
  2. Is there anything we need to adjust in other files that use self.fst_vt?
    (For instance, is self.fst_vt['HydroDyn']['AddCLin'] regarded a 6X6 matrix in other files.)

Thank you very much for your time in advance.

Iman

@dzalkind
Copy link
Collaborator

Hi Iman,

I think your interpretation is correct.

More information about the HydroDyn inputs can be found here: https://openfast.readthedocs.io/en/main/source/user/hydrodyn/input_files.html

I've been wrestling with this same part of the FAST_reader/writer as well over in this repo, but it may have not made it's way into ROSCO yet. Our approaches look similar.

Best, Dna

@iman-tepsco
Copy link
Author

Hi Dna,

Thank you for your reply.

So my understanding appears to be logical.

I have not yet tracked the program to see how self.fst_vt['HydroDyn']['AddCLin'], self.fst_vt['HydroDyn']['AddBLin'], and self.fst_vt['HydroDyn']['AddBQuad'] are utilized.
I only need to know if their dimensions are calculated or if they are assumed to be 6X6 by default.

I would appreciate your response in advance.

Iman

@dzalkind
Copy link
Collaborator

dzalkind commented Sep 1, 2023

Hi Iman,

If more than one potential body is being modeled, it is not 6x6. It is like your proposed code suggests.

Best, Dan

@dzalkind dzalkind self-assigned this May 10, 2024
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

No branches or pull requests

2 participants