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

WingCell.getLoft() error #815

Closed
hardt-fa-flb opened this issue Jul 6, 2021 · 6 comments · Fixed by #828
Closed

WingCell.getLoft() error #815

hardt-fa-flb opened this issue Jul 6, 2021 · 6 comments · Fixed by #828
Assignees
Labels
Milestone

Comments

@hardt-fa-flb
Copy link

hardt-fa-flb commented Jul 6, 2021

I get an error if I try to get the wing cell shape of a test CPACS file with a circular beam:

Beam_Composite_Export_Test_32.zip

The error message:

    self._shape = cell.get_loft().shape()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <tigl3.configuration.CCPACSWingCell; proxy of <Swig Object of type 'tigl::CCPACSWingCell *' at 0x0000029C9945DAB0> >

    def get_loft(self) -> "PNamedShape":
        r"""
        get_loft(CCPACSWingCell self) -> PNamedShape
    
    
        """
>       return _configuration.CCPACSWingCell_get_loft(self)
E       RuntimeError: OpenCASCADE Error: BSpline curve: at least 2 poles required
@joergbrech
Copy link
Contributor

I am sorry for keeping you waiting. When opening your CPACS file in TiGL Viewer, you will see a bunch of error messages in the console:

image

I believe your CPACS file is ill-formed? The eta1 and eta2 coordinates of the inner and outer cell borders need a coordinate and a referenceUID: https://www.cpacs.de/documentation/CPACS_3_3_0_Docs/html/103ad7fc-072e-f9e2-4f26-15266af61839.htm.

Could you please check if fixing this resolves your problem?

@hardt-fa-flb
Copy link
Author

Hey, sorry, the CPCAS-file was ill-formated. I just overlooked the referenceUID element... But thank you for your help!

@hardt-fa-flb
Copy link
Author

Unfortunately there is still an error with the same method and the now valid CPACS file (Beam_Composite_Export_Test_33_cell.zip):

self = <tigl3.configuration.CCPACSWingCell; proxy of <Swig Object of type 'tigl::CCPACSWingCell *' at 0x000001E2028AEB70> >

    def get_loft(self) -> "PNamedShape":
        r"""
        get_loft(CCPACSWingCell self) -> PNamedShape
    
    
        """
>       return _configuration.CCPACSWingCell_get_loft(self)
E       RuntimeError: Cannot associate projected point with (u,v)-coordinates

@hardt-fa-flb hardt-fa-flb reopened this Sep 2, 2021
@joergbrech
Copy link
Contributor

I confirm this is a bug. The logic in the following code block is wrong, we must also differentiate between lower and upper shell when determining the umin and umax values:

if ( border == ChordWiseBorder::TE ) {
if (fabs(u-umin) > tol ){
umin = u;
}
}
else {
if (fabs(umax-u) > tol ){
umax = u;
}
}

As a workaround, you could use the new contour coordinate definition:

<cell uID="test_cell">
    <skin>
        <material>
            <compositeUID>SymmetricBalancedIso</compositeUID>
        </material>
    </skin>
    <positioningInnerBorder>
        <!--
        <eta1>
             <eta>0.3</eta>
             <referenceUID>beam_component_0</referenceUID>
         </eta1>
         <eta2>
             <eta>0.3</eta>
             <referenceUID>beam_component_0</referenceUID>
         </eta2>
        -->
        <contourCoordinate>0.3</contourCoordinate>
    </positioningInnerBorder>
    <positioningLeadingEdge>
        <!--
        <xsi1>0.2</xsi1>
        <xsi2>0.2</xsi2>
	-->
        <contourCoordinate>0.2</contourCoordinate>
    </positioningLeadingEdge>
    <positioningOuterBorder>
        <!--
        <eta1>
            <eta>0.7</eta>
            <referenceUID>beam_component_0</referenceUID>
        </eta1>
        <eta2>
            <eta>0.7</eta>
            <referenceUID>beam_component_0</referenceUID>
        </eta2>
        -->
        <contourCoordinate>0.7</contourCoordinate>
    </positioningOuterBorder>
    <positioningTrailingEdge>
        <!--
        <xsi1>0.8</xsi1>
        <xsi2>0.8</xsi2>
	-->
	<contourCoordinate>0.8</contourCoordinate>
    </positioningTrailingEdge>
</cell>

@joergbrech joergbrech added the bug label Sep 3, 2021
@joergbrech joergbrech self-assigned this Sep 3, 2021
joergbrech added a commit that referenced this issue Sep 10, 2021
joergbrech added a commit that referenced this issue Sep 10, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@joergbrech joergbrech mentioned this issue Sep 10, 2021
5 tasks
@hardt-fa-flb
Copy link
Author

When using the get_loft method with larger models, an unusual behavior occurred: with a small test case (Beam_Composite_Export_Test_32_cell2.xml) with one segment, the get_loft method works for several cells. In a larger test case with several segments (IEA-10.0-198-RWT_CPACS_contour_coordinates.xml), only the cells on the first segment are created correctly. Is that a bug or can only one segment be used with the contour coordinate definition of the cells?

CPACS.zip

@joergbrech
Copy link
Contributor

@hardt-fa-flb, I opened a new issue, because your last comment exposes an issue unrelated to the first one. I think it might be a bug, but I need to dive deeper.

@rainman110 rainman110 added this to the TiGL 3.2.2 milestone Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants