nasa / cape

Computational Aerosciences Productivity & Execution
Other
22 stars 9 forks source link

Define global transformation for databook components #35

Closed khalils2 closed 1 month ago

khalils2 commented 1 month ago

When pulling databook components i noticed cape was applying a default transformation to the coefficient (this might only be in older version of cape?). Is there a way to define a global coordinate transformation for all components? We have almost 100 components and it is very tedious and error prone to track all of these and make sure the correct transformation has been applied to them

nasa-ddalle commented 1 month ago

There is a default transformation that is added (although this might not be applied to every solver... the goal is really to standardize the output from different solvers). That transformation is to just reverse the sign of rolling and yawing moments. I realize this could be annoying, though...

Regarding repeated transformations, yes, there is a way to do something, although it's not quite a global default as you suggested. The component definitions are nested, so you could replace this:

"RSRB": {
    "Type": "FM",
    "Transformation": [
        {
            "Type": "Euler321",
            "psi": "dps",
            "theta": "dth",
            "phi": "dph"
        },
        {
            "Type": "ScaleCoeffs",
            "CLL": -1.0,
            "CLN": -1.0
        }
    ]
},
"RSRB_no_base": {
    "Type": "FM",
    "Transformation": [
        {
            "Type": "Euler321",
            "psi": "dps",
            "theta": "dth",
            "phi": "dph"
        },
        {
            "Type": "ScaleCoeffs",
            "CLL": -1.0,
            "CLN": -1.0
        }
    ]
}

with this:

"RSRB": {
    "Type": "FM",
    "Transformation": [
        {
            "Type": "Euler321",
            "psi": "dps",
            "theta": "dth",
            "phi": "dph"
        },
        {
            "Type": "ScaleCoeffs",
            "CLL": -1.0,
            "CLN": -1.0
        }
    ]
},
"RSRB_no_base": {
    "Type": "RSRB"
}

Helpful? I never actually used this capability before but just did some testing to make sure it works.

khalils2 commented 1 month ago

thanks Derek! that is helpful