From e1999668bdf0a902d6bd2057a6a37776dc3f61fd Mon Sep 17 00:00:00 2001 From: psakiev Date: Sat, 14 Oct 2023 15:30:53 -0600 Subject: [PATCH] Relax projection for FSI mapping to account for curvature --- src/aero/fsi/FSIturbine.C | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/aero/fsi/FSIturbine.C b/src/aero/fsi/FSIturbine.C index 775880c345..b1753a8a26 100644 --- a/src/aero/fsi/FSIturbine.C +++ b/src/aero/fsi/FSIturbine.C @@ -1765,6 +1765,8 @@ fsiTurbine::computeMapping() vs::Vector ptCoords(xyz[0], xyz[1], xyz[2]); bool foundProj = false; double nDimCoord = -1.0; + double minDispMapInterp = 1.0e6; + int minDispMap = 1e6; for (int i = 0; i < nPtsBlade - 1; i++) { vs::Vector lStart = { brFSIdata_.bld_ref_pos[(iStart + i) * 6], @@ -1776,6 +1778,11 @@ fsiTurbine::computeMapping() brFSIdata_.bld_ref_pos[(iStart + i + 1) * 6 + 2]}; nDimCoord = fsi::projectPt2Line(ptCoords, lStart, lEnd); + if(std::abs(nDimCoord) < minDispMapInterp){ + minDispMapInterp = std::abs(nDimCoord); + minDispMap = i; + } + if ((nDimCoord >= 0) && (nDimCoord <= 1.0)) { foundProj = true; *dispMapInterpNode = nDimCoord; @@ -1785,6 +1792,14 @@ fsiTurbine::computeMapping() } } + // if we are very very close to a point then we need to use it + // curvature issues can break the projection + if(!foundProj && minDispMapInterp < 0.50){ + *dispMapInterpNode = 0.0; + *dispMapNode = minDispMap; + foundProj = true; + } + // If no element in the OpenFAST mesh contains this node do some sanity // check on the perpendicular distance between the surface mesh node and // the line joining the ends of the blade