Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
1816c3b
See Issue 735. Allow BC_Sym_Plane to be used as slip wall for viscous…
TobiKattmann Jul 23, 2019
18905e7
Added information in config_template to use MARKER_SYM for slip walls in
TobiKattmann Jul 23, 2019
1436847
Change Regression test values. MARKER_EULER not used for slip wall in
TobiKattmann Jul 23, 2019
060797e
Remove Unused Variables to not generate more warnings.
TobiKattmann Jul 23, 2019
b7ee8d5
Change Regressiontest value of euler ONERAM6. Unit Normal changes a t…
TobiKattmann Jul 23, 2019
2af4024
Merged EulerWall and SymPlane into SlipWall.
TobiKattmann Jul 31, 2019
779d353
Merge remote-tracking branch 'origin/develop' into fix_SlipWall
TobiKattmann Jul 31, 2019
dc4cd06
Finalize Marker slip-wall for incompressible flow.
TobiKattmann Jul 31, 2019
6bfe577
Merge remote-tracking branch 'origin/develop' into fix_SlipWall
Aug 1, 2019
49f3c1c
BC_Sym_Plane used for Euler_wall in inc+comp flow.
Aug 1, 2019
1ca346c
Revert unnecessary changes.
TobiKattmann Aug 1, 2019
3e0283e
Merge remote-tracking branch 'origin/develop' into fix_SlipWall
TobiKattmann Aug 5, 2019
f24eb4b
Added parallel comm for bound_is_straight boolean vector.
TobiKattmann Aug 5, 2019
91be1f6
Req Changes for PR 740
TobiKattmann Aug 13, 2019
07d1f21
Merge remote-tracking branch 'origin/develop' into fix_SlipWall
TobiKattmann Aug 13, 2019
c1a2d8a
Merge remote-tracking branch 'origin/develop' into fix_SlipWall
TobiKattmann Aug 14, 2019
74902e0
FIxes for PR 740.
TobiKattmann Aug 19, 2019
4566256
Merge remote-tracking branch 'origin/develop' into fix_SlipWall
TobiKattmann Aug 19, 2019
25cef5e
Switched unit tangential computation.
TobiKattmann Aug 20, 2019
c10e87e
Reset excecutable bits where necessary.
TobiKattmann Aug 20, 2019
737f329
Reset previously forgotten excecutable bit.
TobiKattmann Aug 20, 2019
b51c713
Fix failing serial and AD builds.
TobiKattmann Aug 21, 2019
80b659e
Merge remote-tracking branch 'origin/develop' into fix_SlipWall
TobiKattmann Aug 21, 2019
4f823bf
Exclude hom-cases from straightness check. Removed wrong 'break'
TobiKattmann Aug 21, 2019
d9cb856
Merge remote-tracking branch 'origin/develop' into fix_SlipWall
TobiKattmann Aug 25, 2019
ca1d43b
Adapted first chunk of Reg test values for PR740
TobiKattmann Aug 25, 2019
bc3c569
Merge remote-tracking branch 'origin/develop' into fix_SlipWall
TobiKattmann Aug 26, 2019
41753f5
Merge remote-tracking branch 'origin/develop' into fix_SlipWall
TobiKattmann Aug 26, 2019
7530768
Wrong FaceArea computation fixed.
TobiKattmann Aug 28, 2019
10ed434
Merge remote-tracking branch 'origin/develop' into fix_SlipWall
TobiKattmann Aug 29, 2019
3f4980c
Added a missing doxygen documentation piece.
TobiKattmann Sep 2, 2019
c4fb36d
Merge remote-tracking branch 'origin/develop' into fix_SlipWall
TobiKattmann Sep 2, 2019
44e5cce
Fixed Bug for Sym_BC if used with Elasticity. Trailing Whitespace cle…
TobiKattmann Sep 2, 2019
be48f3c
Merge remote-tracking branch 'origin/develop' into fix_SlipWall
TobiKattmann Sep 2, 2019
1d24682
Tiny bugfix which failed the builds.
TobiKattmann Sep 2, 2019
a8da66b
Merge remote-tracking branch 'origin/develop' into fix_SlipWall
TobiKattmann Sep 9, 2019
bfadd77
Yet another bug in the BoundaryStraightness routine. fml
TobiKattmann Sep 16, 2019
4069e1b
PR740. Some more reg test adaptions.
TobiKattmann Sep 17, 2019
4a5a246
PR740: Fixing the first cont_adj regression test.
TobiKattmann Sep 18, 2019
d262db7
Fixing cont.adj. Euler regression tests. Introducing override keyword…
TobiKattmann Sep 20, 2019
c47e5e4
Merge remote-tracking branch 'origin/develop' into fix_SlipWall
TobiKattmann Sep 24, 2019
1f1fa29
PR740 adapting antother chunk of Reg.test values.
TobiKattmann Sep 30, 2019
c85e740
PR740 Reg.test filediff changes.
TobiKattmann Sep 30, 2019
1de4655
Fix little error in serial_reg_AD.py.
TobiKattmann Sep 30, 2019
114e21b
PR740 Reg.test adaption. Wrong end-of-line of filediffs due to windows.
TobiKattmann Sep 30, 2019
db24032
Revert .travis.yml
TobiKattmann Sep 30, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions Common/include/config_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2927,10 +2927,28 @@ class CConfig {
su2double *GetWeightsIntegrationADER_DG(void);

/*!
* \brief Get the total number of boundary markers.
* \brief Get the total number of boundary markers including send/receive domains.
* \return Total number of boundary markers.
*/
unsigned short GetnMarker_All(void);

/*!
* \brief Get the total number of boundary markers in the config file.
* \return Total number of boundary markers.
*/
unsigned short GetnMarker_CfgFile(void);

/*!
* \brief Get the number of Euler boundary markers.
* \return Number of Euler boundary markers.
*/
unsigned short GetnMarker_Euler(void);

/*!
* \brief Get the number of symmetry boundary markers.
* \return Number of symmetry boundary markers.
*/
unsigned short GetnMarker_SymWall(void);

/*!
* \brief Get the total number of boundary markers.
Expand Down Expand Up @@ -6579,6 +6597,13 @@ class CConfig {
*/
unsigned short GetMarker_Moving(string val_marker);

/*!
* \brief Get bool if marker is moving. <i>val_marker</i>.
* \param[in] val_marker - String of the marker to test.
* \return Bool if the marker is a moving boundary <i>val_marker</i>.
*/
bool GetMarker_Moving_Bool(string val_marker);

/*!
* \brief Get the internal index for a DEFORM_MESH boundary <i>val_marker</i>.
* \return Internal index for a DEFORM_MESH boundary <i>val_marker</i>.
Expand All @@ -6590,7 +6615,7 @@ class CConfig {
* \return Internal index for a Fluid_Load boundary <i>val_marker</i>.
*/
unsigned short GetMarker_Fluid_Load(string val_marker);

/*!
* \brief Get the name of the surface defined in the geometry file.
* \param[in] val_marker - Value of the marker in which we are interested.
Expand Down
6 changes: 6 additions & 0 deletions Common/include/config_structure.inl
Original file line number Diff line number Diff line change
Expand Up @@ -1432,6 +1432,12 @@ inline unsigned short CConfig::GetMarker_All_PyCustom(unsigned short val_marker)

inline unsigned short CConfig::GetnMarker_All(void) { return nMarker_All; }

inline unsigned short CConfig::GetnMarker_CfgFile(void) { return nMarker_CfgFile; }

inline unsigned short CConfig::GetnMarker_Euler(void) { return nMarker_Euler; }

inline unsigned short CConfig::GetnMarker_SymWall(void) { return nMarker_SymWall; }

inline unsigned short CConfig::GetnMarker_Max(void) { return nMarker_Max; }

inline unsigned short CConfig::GetnMarker_EngineInflow(void) { return nMarker_EngineInflow; }
Expand Down
11 changes: 11 additions & 0 deletions Common/include/geometry_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ class CGeometry {
CVertex*** vertex; /*!< \brief Boundary Vertex vector (dual grid information). */
CTurboVertex**** turbovertex; /*!< \brief Boundary Vertex vector ordered for turbomachinery calculation(dual grid information). */
unsigned long *nVertex; /*!< \brief Number of vertex for each marker. */
vector<bool> bound_is_straight; /*!< \brief Bool if boundary-marker is straight(2D)/plane(3D) for each local marker. */
unsigned short *nSpanWiseSections; /*!< \brief Number of Span wise section for each turbo marker, indexed by inflow/outflow */
unsigned short *nSpanSectionsByMarker; /*! <\brief Number of Span wise section for each turbo marker, indexed by marker. Needed for deallocation.*/
unsigned short nTurboPerf; /*!< \brief Number of Span wise section for each turbo marker. */
Expand Down Expand Up @@ -1036,6 +1037,16 @@ class CGeometry {
*/
virtual void SetRestricted_GridVelocity(CGeometry *fine_mesh, CConfig *config);

/*!
* \brief Check if a boundary is straight(2D) / plane(3D) for EULER_WALL and SYMMETRY_PLANE
* only and store the information in bound_is_straight. For all other boundary types
* this will return false and could therfore be wrong. Used ultimately for BC_Slip_Wall.
* \param[in] config - Definition of the particular problem.
* \param[in] print_on_screen - Boolean whether to print result on screen.
*/
void ComputeSurf_Straightness(CConfig *config,
bool print_on_screen);

/*!
* \brief Find and store all vertices on a sharp corner in the geometry.
* \param[in] config - Definition of the particular problem.
Expand Down
1 change: 1 addition & 0 deletions Common/include/mpi_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ class CMediMPIWrapper: public CBaseMPIWrapper {
#define MPI_MIN 9
#define MPI_MAX 10
#define MPI_INT 11
#define MPI_PROD 12
class CBaseMPIWrapper {

public:
Expand Down
10 changes: 10 additions & 0 deletions Common/src/config_structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8112,6 +8112,16 @@ unsigned short CConfig::GetMarker_Moving(string val_marker) {
return iMarker_Moving;
}

bool CConfig::GetMarker_Moving_Bool(string val_marker) {
unsigned short iMarker_Moving;

/*--- Find the marker for this moving boundary, if it exists. ---*/
for (iMarker_Moving = 0; iMarker_Moving < nMarker_Moving; iMarker_Moving++)
if (Marker_Moving[iMarker_Moving] == val_marker) return true;

return false;
}

unsigned short CConfig::GetMarker_Deform_Mesh(string val_marker) {
unsigned short iMarker_Deform_Mesh;

Expand Down
143 changes: 143 additions & 0 deletions Common/src/geometry_structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2796,6 +2796,149 @@ void CGeometry::UpdateCustomBoundaryConditions(CGeometry **geometry_container, C
}
}


void CGeometry::ComputeSurf_Straightness(CConfig *config,
bool print_on_screen) {

bool RefUnitNormal_defined;
unsigned short iDim,
iMarker,
iMarker_Global,
nMarker_Global = config->GetnMarker_CfgFile();
unsigned long iVertex;
constexpr passivedouble epsilon = 1.0e-6;
su2double Area;
string Local_TagBound,
Global_TagBound;

vector<su2double> Normal(nDim),
UnitNormal(nDim),
RefUnitNormal(nDim);

/*--- Assume now that this boundary marker is straight. As soon as one
AreaElement is found that is not aligend with a Reference then it is
certain that the boundary marker is not straight and one can stop
searching. Another possibility is that this process doesn't own
any nodes of that boundary, in that case we also have to assume the
boundary is straight.
Any boundary type other than SYMMETRY_PLANE or EULER_WALL gets
the value false (or see cases specified in the conditional below)
which could be wrong. ---*/
bound_is_straight.resize(nMarker);
fill(bound_is_straight.begin(), bound_is_straight.end(), true);

/*--- Loop over all local markers ---*/
for (iMarker = 0; iMarker < nMarker; iMarker++) {

Local_TagBound = config->GetMarker_All_TagBound(iMarker);

/*--- Marker has to be Symmetry or Euler. Additionally marker can't be a
moving surface and Grid Movement Elasticity is forbidden as well. All
other GridMovements are rigid. ---*/
if ((config->GetMarker_All_KindBC(iMarker) == SYMMETRY_PLANE ||
config->GetMarker_All_KindBC(iMarker) == EULER_WALL) &&
config->GetMarker_Moving_Bool(Local_TagBound) == false &&
config->GetKind_GridMovement() != ELASTICITY) {

/*--- Loop over all global markers, and find the local-global pair via
matching unique string tags. ---*/
for (iMarker_Global = 0; iMarker_Global < nMarker_Global; iMarker_Global++) {

Global_TagBound = config->GetMarker_CfgFile_TagBound(iMarker_Global);
if (Local_TagBound == Global_TagBound) {

RefUnitNormal_defined = false;
iVertex = 0;

while(bound_is_straight[iMarker] == true &&
iVertex < nVertex[iMarker]) {

vertex[iMarker][iVertex]->GetNormal(Normal.data());
UnitNormal = Normal;

/*--- Compute unit normal. ---*/
Area = 0.0;
for (iDim = 0; iDim < nDim; iDim++)
Area += Normal[iDim]*Normal[iDim];
Area = sqrt(Area);

/*--- Negate for outward convention. ---*/
for (iDim = 0; iDim < nDim; iDim++)
UnitNormal[iDim] /= -Area;

/*--- Check if unit normal is within tolerance of the Reference unit normal.
Reference unit normal = first unit normal found. ---*/
if(RefUnitNormal_defined) {
for (iDim = 0; iDim < nDim; iDim++) {
if( abs(RefUnitNormal[iDim] - UnitNormal[iDim]) > epsilon ) {
bound_is_straight[iMarker] = false;
break;
}
}
} else {
RefUnitNormal = UnitNormal; //deep copy of values
RefUnitNormal_defined = true;
}

iVertex++;
}//while iVertex
}//if Local == Global
}//for iMarker_Global
} else {
/*--- Enforce default value: false ---*/
bound_is_straight[iMarker] = false;
}//if sym or euler ...
}//for iMarker

/*--- Communicate results and print on screen. ---*/
if(print_on_screen) {

/*--- Additional vector which can later be MPI::Allreduce(d) to pring the results
on screen as nMarker (local) can vary across ranks. Default 'true' as it can
happen that a local rank does not contain an element of each surface marker. ---*/
vector<bool> bound_is_straight_Global(nMarker_Global, true);
/*--- Match local with global tag bound and fill a Global Marker vector. ---*/
for (iMarker = 0; iMarker < nMarker; iMarker++) {
Local_TagBound = config->GetMarker_All_TagBound(iMarker);
for (iMarker_Global = 0; iMarker_Global < nMarker_Global; iMarker_Global++) {
Global_TagBound = config->GetMarker_CfgFile_TagBound(iMarker_Global);

if(Local_TagBound == Global_TagBound)
bound_is_straight_Global[iMarker_Global] = bound_is_straight[iMarker];

}//for iMarker_Global
}//for iMarker

vector<int> Buff_Send_isStraight(nMarker_Global),
Buff_Recv_isStraight(nMarker_Global);

/*--- Cast to int as std::vector<boolean> can be a special construct. MPI handling using <int>
is more straight-forward. ---*/
for (iMarker_Global = 0; iMarker_Global < nMarker_Global; iMarker_Global++)
Buff_Send_isStraight[iMarker_Global] = static_cast<int> (bound_is_straight_Global[iMarker_Global]);

/*--- Product of type <int>(bool) is equivalnt to a 'logical and' ---*/
SU2_MPI::Allreduce(Buff_Send_isStraight.data(), Buff_Recv_isStraight.data(),
nMarker_Global, MPI_INT, MPI_PROD, MPI_COMM_WORLD);

/*--- Print results on screen. ---*/
if(rank == MASTER_NODE) {
for (iMarker_Global = 0; iMarker_Global < nMarker_Global; iMarker_Global++) {
if (config->GetMarker_CfgFile_KindBC(config->GetMarker_CfgFile_TagBound(iMarker_Global)) == SYMMETRY_PLANE ||
config->GetMarker_CfgFile_KindBC(config->GetMarker_CfgFile_TagBound(iMarker_Global)) == EULER_WALL) {

cout << "Boundary marker " << config->GetMarker_CfgFile_TagBound(iMarker_Global) << " is";
if(Buff_Recv_isStraight[iMarker_Global] == false) cout << " NOT";
if(nDim == 2) cout << " a single straight." << endl;
if(nDim == 3) cout << " a single plane." << endl;
}//if sym or euler
}//for iMarker_Global
}//if rank==MASTER
}//if print_on_scren

}


void CGeometry::ComputeSurf_Curvature(CConfig *config) {
unsigned short iMarker, iNeigh_Point, iDim, iNode, iNeighbor_Nodes, Neighbor_Node;
unsigned long Neighbor_Point, iVertex, iPoint, jPoint, iElem_Bound, iEdge, nLocalVertex, MaxLocalVertex , *Buffer_Send_nVertex, *Buffer_Receive_nVertex, TotalnPointDomain;
Expand Down
Loading