Skip to content

Commit

Permalink
Merge pull request #931 from DLR-SC/930-wrong-wing-cell-generation-of…
Browse files Browse the repository at this point in the history
…-the-lower-shell

Fix bug in wing cell creation
  • Loading branch information
joergbrech authored Nov 7, 2022
2 parents bc2e1d4 + 83a94f1 commit dc973ee
Show file tree
Hide file tree
Showing 3 changed files with 4,716 additions and 7 deletions.
27 changes: 20 additions & 7 deletions src/wing/CCPACSWingCell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,20 +661,26 @@ void CCPACSWingCell::TrimChordwise(GeometryCache& cache,
||(border == ChordWiseBorder::TE && !upper)) {
if ( fabs(u - umin) > tol ) {
umin = u;
current->GetAnnotation().ccmin = trim_coordinate;
trim = true;
}
}
if ( (border == ChordWiseBorder::TE && upper)
||(border == ChordWiseBorder::LE && !upper)) {
if ( fabs(umax - u) > tol ) {
umax = u;
current->GetAnnotation().ccmax = trim_coordinate;
trim = true;
}
}

if (trim) {
// update annotation
if (border == ChordWiseBorder::LE) {
current->GetAnnotation().ccmin = trim_coordinate;
} else {
current->GetAnnotation().ccmax = trim_coordinate;
}

// replace face
current->ReplaceFace(TrimFace(current->GetFace(),
umin,
umax,
Expand Down Expand Up @@ -872,16 +878,23 @@ void CCPACSWingCell::BuildSkinGeometry(GeometryCache& cache) const
double spanwise_contour_coordinate = 0;
for (auto row = cache.rgsurface.Root(); row; row = row->VNext()) {
int i = 0;
double chordwise_contour_coordinate = 0;
double chordwise_contour_coordinate = UPPER_SIDE? 0. : 1.;
for (auto current = row; current; current = current->UNext()){
current->GetAnnotation().scmin = spanwise_contour_coordinate;
current->GetAnnotation().scmax = spanwise_contour_coordinate
+ (current->VMax() - current->VMin())/col_ranges[i];

current->GetAnnotation().ccmin = chordwise_contour_coordinate;
current->GetAnnotation().ccmax = chordwise_contour_coordinate
+ (current->UMax() - current->UMin())/row_ranges[j];
chordwise_contour_coordinate = current->GetAnnotation().ccmax;
if (UPPER_SIDE) {
current->GetAnnotation().ccmin = chordwise_contour_coordinate;
current->GetAnnotation().ccmax = chordwise_contour_coordinate
+ (current->UMax() - current->UMin())/row_ranges[j];
chordwise_contour_coordinate = current->GetAnnotation().ccmax;
} else {
current->GetAnnotation().ccmax = chordwise_contour_coordinate;
current->GetAnnotation().ccmin = chordwise_contour_coordinate
- (current->UMax() - current->UMin())/row_ranges[j];
chordwise_contour_coordinate = current->GetAnnotation().ccmin;
}

i++;
if (!(current->UNext()))
Expand Down
Loading

0 comments on commit dc973ee

Please sign in to comment.