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

Darpa ml #3

Open
wants to merge 3 commits into
base: darpa
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
27 changes: 26 additions & 1 deletion Common/include/config_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,26 @@ using namespace std;
* \version 4.1.2 "Cardinal"
*/

struct StrainItem{

vector<unsigned long> IndexCurr;
vector<double> p1;
vector<double> walldist;
vector<unsigned long> IndexBndy;
vector<double> strain_rate;
vector<double> mu_t;

};

struct TauItem{

vector<unsigned long> IndexCurr;
vector<double> TauTangent;

};

class CConfig {

private:
unsigned short Kind_SU2; /*!< \brief Kind of SU2 software component.*/
unsigned short Ref_NonDim; /*!< \brief Kind of non dimensionalization.*/
Expand Down Expand Up @@ -730,7 +749,7 @@ class CConfig {
bool ParMETIS; /*!< \brief Boolean for activating ParMETIS mode (while testing). */
unsigned short DirectDiff; /*!< \brief Direct Differentation mode. */
bool DiscreteAdjoint; /*!< \brief AD-based discrete adjoint mode. */

double *betaArr; /*!< \brief Array for values of SA_Production_Factor >*/

/*--- all_options is a map containing all of the options. This is used during config file parsing
to track the options which have not been set (so the default values can be used). Without this map
Expand Down Expand Up @@ -1016,6 +1035,8 @@ class CConfig {

public:

StrainItem StrainFile;
TauItem TauFile;
vector<string> fields; /*!< \brief Tags for the different fields in a restart file. */

/*!
Expand Down Expand Up @@ -1469,6 +1490,8 @@ class CConfig {

su2double GetSA_Production_Factor(void);

double GetbetaArr(int index);

/*!
* \brief Get the value of the non-dimensionalized freestream pressure.
* \return Non-dimensionalized freestream pressure.
Expand Down Expand Up @@ -1862,6 +1885,8 @@ class CConfig {

void SetSA_Production_Factor(su2double val_SA_Production_Factor);

void SetbetaArr(double *val_betaArr);

/*!
* \brief Set the Froude number for free surface problems.
* \return Value of the Froude number.
Expand Down
4 changes: 4 additions & 0 deletions Common/include/config_structure.inl
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ inline su2double CConfig::GetPressure_FreeStream(void) { return Pressure_FreeStr

inline su2double CConfig::GetSA_Production_Factor(void) { return SA_Production_Factor; }

inline double CConfig::GetbetaArr(int index) { return betaArr[index]; }

inline su2double CConfig::GetTemperature_ve_FreeStream(void) { return Temperature_ve_FreeStream; }

inline su2double CConfig::GetPrandtl_Lam(void) { return Prandtl_Lam; }
Expand Down Expand Up @@ -307,6 +309,8 @@ inline void CConfig::SetPressure_FreeStreamND(su2double val_pressure_freestreamn

inline void CConfig::SetSA_Production_Factor(su2double val_SA_Production_Factor) { SA_Production_Factor = val_SA_Production_Factor; }

inline void CConfig::SetbetaArr(double *val_betaArr){ betaArr = val_betaArr; }

inline void CConfig::SetPressure_FreeStream(su2double val_pressure_freestream) { Pressure_FreeStream = val_pressure_freestream; }

inline void CConfig::SetDensity_FreeStreamND(su2double val_density_freestreamnd) { Density_FreeStreamND = val_density_freestreamnd; }
Expand Down
8 changes: 7 additions & 1 deletion Common/include/dual_grid_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ class CPoint : public CDualGrid {
bool Move; /*!< \brief This flag indicates if the point is going to be move in the grid deformation process. */
unsigned short color; /*!< \brief Color of the point in the partitioning strategy. */
su2double Wall_Distance; /*!< \brief Distance to the nearest wall. */
unsigned long Vertex_nearWall; /*!< \brief Global index of the wall vertex nearest to the cell >*/
su2double SharpEdge_Distance; /*!< \brief Distance to a sharp edge. */
su2double Curvature; /*!< \brief Value of the surface curvature (SU2_GEO). */
unsigned long GlobalIndex; /*!< \brief Global index in the parallel simulation. */
Expand Down Expand Up @@ -221,6 +222,9 @@ class CPoint : public CDualGrid {
* \param[in] val_distance - Value of the distance.
*/
void SetWall_Distance(su2double val_distance);

void SetVertex_nearWall(unsigned long val_Vertex_nearWall);


/*!
* \brief Set the value of the distance to a sharp edge.
Expand All @@ -233,7 +237,9 @@ class CPoint : public CDualGrid {
* \return Value of the distance to the nearest wall.
*/
su2double GetWall_Distance(void);


unsigned long GetVertex_nearWall(void);

/*!
* \brief Set the value of the curvature at a surface node.
* \param[in] val_curvature - Value of the curvature.
Expand Down
4 changes: 4 additions & 0 deletions Common/include/dual_grid_structure.inl
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,16 @@ inline bool CPoint::GetDomain(void) { return Domain; }

inline void CPoint::SetWall_Distance(su2double val_distance) { Wall_Distance = val_distance; }

inline void CPoint::SetVertex_nearWall(unsigned long val_Vertex_nearWall) { Vertex_nearWall = val_Vertex_nearWall; }

inline void CPoint::SetCurvature(su2double val_curvature) { Curvature = val_curvature; }

inline void CPoint::SetSharpEdge_Distance(su2double val_distance) { SharpEdge_Distance = val_distance; }

inline su2double CPoint::GetWall_Distance(void) { return Wall_Distance; }

inline unsigned long CPoint::GetVertex_nearWall(void) { return Vertex_nearWall; }

inline su2double CPoint::GetCurvature(void) { return Curvature; }

inline su2double CPoint::GetSharpEdge_Distance(void) { return SharpEdge_Distance; }
Expand Down
22 changes: 17 additions & 5 deletions Common/src/geometry_structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8677,8 +8677,9 @@ void CPhysicalGeometry::ComputeWall_Distance(CConfig *config) {

/*--- Allocate an array to hold boundary node coordinates ---*/

su2double **Coord_bound;
su2double **Coord_bound, **pNormal, *pind;
Coord_bound = new su2double* [nVertex_SolidWall];
pind = new su2double [nVertex_SolidWall];
for (iVertex = 0; iVertex < nVertex_SolidWall; iVertex++)
Coord_bound[iVertex] = new su2double [nDim];

Expand All @@ -8692,6 +8693,7 @@ void CPhysicalGeometry::ComputeWall_Distance(CConfig *config) {
iPoint = vertex[iMarker][iVertex]->GetNode();
for (iDim = 0; iDim < nDim; iDim++)
Coord_bound[nVertex_SolidWall][iDim] = node[iPoint]->GetCoord(iDim);
pind[nVertex_SolidWall] = node[iPoint]->GetGlobalIndex();
nVertex_SolidWall++;
}
}
Expand Down Expand Up @@ -8731,6 +8733,7 @@ void CPhysicalGeometry::ComputeWall_Distance(CConfig *config) {
(coord[iDim] - Coord_bound[iVertex_nearestWall][iDim]);
}
node[iPoint]->SetWall_Distance(sqrt(dist));
node[iPoint]->SetVertex_nearWall(pind[iVertex_nearestWall]);
}
}
else {
Expand Down Expand Up @@ -8776,9 +8779,12 @@ void CPhysicalGeometry::ComputeWall_Distance(CConfig *config) {
/*--- Create and initialize to zero some buffers to hold the coordinates
of the boundary nodes that are communicated from each partition (all-to-all). ---*/

su2double *Buffer_Send_Coord = new su2double [MaxLocalVertex_NS*nDim];
su2double *Buffer_Receive_Coord = new su2double [nProcessor*MaxLocalVertex_NS*nDim];
unsigned long nBuffer = MaxLocalVertex_NS*nDim;
su2double *Buffer_Send_Coord = new su2double [MaxLocalVertex_NS*nDim];
unsigned long *Buffer_Send_Index = new unsigned long [MaxLocalVertex_NS];
su2double *Buffer_Receive_Coord = new su2double [nProcessor*MaxLocalVertex_NS*nDim];
unsigned long *Buffer_Receive_Index = new unsigned long [nProcessor*MaxLocalVertex_NS];
unsigned long nBuffer = MaxLocalVertex_NS*nDim;
unsigned long nBufferIndex = MaxLocalVertex_NS;

for (iVertex = 0; iVertex < MaxLocalVertex_NS; iVertex++)
for (iDim = 0; iDim < nDim; iDim++)
Expand All @@ -8793,12 +8799,15 @@ void CPhysicalGeometry::ComputeWall_Distance(CConfig *config) {
(config->GetMarker_All_KindBC(iMarker) == ISOTHERMAL) )
for (iVertex = 0; iVertex < GetnVertex(iMarker); iVertex++) {
iPoint = vertex[iMarker][iVertex]->GetNode();
for (iDim = 0; iDim < nDim; iDim++)
for (iDim = 0; iDim < nDim; iDim++){
Buffer_Send_Coord[nVertex_SolidWall*nDim+iDim] = node[iPoint]->GetCoord(iDim);
}
Buffer_Send_Index[nVertex_SolidWall] = node[iPoint]->GetGlobalIndex();
nVertex_SolidWall++;
}

SU2_MPI::Allgather(Buffer_Send_Coord, nBuffer, MPI_DOUBLE, Buffer_Receive_Coord, nBuffer, MPI_DOUBLE, MPI_COMM_WORLD);
SU2_MPI::Allgather(Buffer_Send_Index, nBufferIndex, MPI_UNSIGNED_LONG, Buffer_Receive_Index, nBufferIndex, MPI_UNSIGNED_LONG, MPI_COMM_WORLD);

/*--- Loop over all interior mesh nodes on the local partition and compute
the distances to each of the no-slip boundary nodes in the entire mesh.
Expand Down Expand Up @@ -8840,6 +8849,7 @@ void CPhysicalGeometry::ComputeWall_Distance(CConfig *config) {
(coord[iDim] - Buffer_Receive_Coord[iVertex_nearestWall*nDim+iDim]);
}
node[iPoint]->SetWall_Distance(sqrt(dist));
node[iPoint]->SetVertex_nearWall(Buffer_Receive_Index[iVertex_nearestWall]);
}
}
else {
Expand All @@ -8851,6 +8861,8 @@ void CPhysicalGeometry::ComputeWall_Distance(CConfig *config) {

delete[] Buffer_Send_Coord;
delete[] Buffer_Receive_Coord;
delete[] Buffer_Send_Index;
delete[] Buffer_Receive_Index;
delete[] Buffer_Send_nVertex;
delete[] Buffer_Receive_nVertex;

Expand Down
Binary file modified SU2_AD/SU2_CFD/bin/SU2_CFD_AD
Binary file not shown.
Binary file modified SU2_AD/SU2_DOT/bin/SU2_DOT_AD
Binary file not shown.
Binary file modified SU2_BASE/SU2_CFD/bin/SU2_CFD
Binary file not shown.
Binary file modified SU2_BASE/SU2_DEF/bin/SU2_DEF
Binary file not shown.
Binary file modified SU2_BASE/SU2_DOT/bin/SU2_DOT
Binary file not shown.
Binary file modified SU2_BASE/SU2_GEO/bin/SU2_GEO
Binary file not shown.
Binary file modified SU2_BASE/SU2_MSH/bin/SU2_MSH
Binary file not shown.
Binary file modified SU2_BASE/SU2_SOL/bin/SU2_SOL
Binary file not shown.
Loading