Skip to content
Merged
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
6 changes: 5 additions & 1 deletion SU2_CFD/include/drivers/CDriver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,11 @@ class CDriver {
* \param[in] iVertex - Vertex identifier.
* \return Unit normal (vector) at the vertex.
*/
vector<passivedouble> GetVertexUnitNormal(unsigned short iMarker, unsigned long iVertex) const;
vector<passivedouble> GetVertexNormal(unsigned short iMarker, unsigned long iVertex, bool unitNormal = false) const;

inline vector<passivedouble> GetVertexUnitNormal(unsigned short iMarker, unsigned long iVertex) const {
return GetVertexNormal(iMarker, iVertex, true);
}

/*!
* \brief Get all the boundary markers tags.
Expand Down
11 changes: 10 additions & 1 deletion SU2_CFD/src/python_wrapper_structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ vector<passivedouble> CDriver::GetInitialMeshCoord(unsigned short iMarker, unsig
return coord_passive;
}

vector<passivedouble> CDriver::GetVertexUnitNormal(unsigned short iMarker, unsigned long iVertex) const {
vector<passivedouble> CDriver::GetVertexNormal(unsigned short iMarker, unsigned long iVertex, bool unitNormal) const {

su2double *Normal;
su2double Area;
Expand All @@ -237,6 +237,15 @@ vector<passivedouble> CDriver::GetVertexUnitNormal(unsigned short iMarker, unsig

Normal = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNormal();

if (!unitNormal) {

ret_Normal_passive[0] = SU2_TYPE::GetValue(Normal[0]);
ret_Normal_passive[1] = SU2_TYPE::GetValue(Normal[1]);
if(nDim>2) ret_Normal_passive[2] = SU2_TYPE::GetValue(Normal[2]);

return ret_Normal_passive;
}

Area = GeometryToolbox::Norm(nDim, Normal);

ret_Normal[0] = Normal[0]/Area;
Expand Down
1 change: 1 addition & 0 deletions SU2_CFD/src/solvers/CMeshSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ void CMeshSolver::SetMinMaxVolume(CGeometry *geometry, CConfig *config, bool upd
SU2_OMP_BARRIER

AD::EndPassive(wasActive);

}

void CMeshSolver::SetWallDistance(CGeometry *geometry, CConfig *config) {
Expand Down
11 changes: 2 additions & 9 deletions SU2_PY/FSI_tools/FSIInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1900,8 +1900,8 @@ def UnsteadyFSI(self,FSI_config, FluidSolver, SolidSolver):

if FSI_config['RESTART_SOL'] == 'YES':
NbTimeIter = ((totTime)/deltaT)-1
time = (FSI_config['RESTART_ITER']+1)*deltaT
TimeIter = FSI_config['RESTART_ITER']+1
time = (FSI_config['RESTART_ITER'])*deltaT
TimeIter = FSI_config['RESTART_ITER']
else:
NbTimeIter = (totTime/deltaT)-1 # number of time iterations
time = 0.0 # initial time
Expand All @@ -1922,13 +1922,6 @@ def UnsteadyFSI(self,FSI_config, FluidSolver, SolidSolver):
TimeIterTreshold = -1
self.getSolidInterfaceDisplacement(SolidSolver)
self.displacementPredictor(FSI_config, SolidSolver, deltaT)
# We need now to update the solution because both restarter functions (solid and fluid)
# load the files in the solution containers, pushing back the previous solutions. We need
# then to push it back once more to compute the solution at the next time level
# Also this is required because in the fluid iteration preprocessor, if we do not update
# and step to the next time level, there is a flag "fsi" that will initialise the flow
if myid in self.fluidSolverProcessors:
FluidSolver.Update()
if myid in self.solidSolverProcessors:
SolidSolver.updateSolution()
#If no restart
Expand Down
3 changes: 3 additions & 0 deletions SU2_PY/FSI_tools/FSI_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,6 @@ def applyDefaults(self):
if self._ConfigContent["CSD_SOLVER"] == "IMPOSED":
self._ConfigContent["AITKEN_RELAX"] = "STATIC"
self._ConfigContent["AITKEN_PARAM"] = 1.0

if self._ConfigContent["RESTART_SOL"] == "YES":
self._ConfigContent["TIME_TRESHOLD"] = -1
12 changes: 4 additions & 8 deletions SU2_PY/SU2_Nastran/pysu2_nastran.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ def __computeInterfacePosVel(self, initialize):
Y_disp = self.Uy.dot(self.q)
Z_disp = self.Uz.dot(self.q)

for iPoint in range(len(self.node)):
for iPoint in range(self.nPoint):
coord0 = self.node[iPoint].GetCoord0()
self.node[iPoint].SetCoord((X_disp[iPoint]+coord0[0],Y_disp[iPoint]+coord0[1],Z_disp[iPoint]+coord0[2]))
self.node[iPoint].SetVel((X_vel[iPoint],Y_vel[iPoint],Z_vel[iPoint]))
Expand Down Expand Up @@ -870,7 +870,7 @@ def __setRestart(self, timeIter):
print("The restart iteration was not found in the structural history")
break
line = line.strip('\r\n').split()
if int(line[1])==(self.Config["RESTART_ITER"]-1):
if int(line[1])==(self.Config["RESTART_ITER"]-2):
break
index = 0
for index_mode in range(self.nDof):
Expand All @@ -896,7 +896,7 @@ def __setRestart(self, timeIter):
print("The restart iteration was not found in the structural history")
break
line = line.strip('\r\n').split()
if int(line[1])==self.Config["RESTART_ITER"]:
if int(line[1])==(self.Config["RESTART_ITER"]-1):
break
index = 0
for index_mode in range(self.nDof):
Expand Down Expand Up @@ -935,11 +935,7 @@ def updateSolution(self):
self.__reset(self.qddot)
self.__reset(self.a)

makerID = list(self.markers.keys())
makerID = makerID[0]
nodeList = self.markers[makerID]

for iPoint in nodeList:
for iPoint in range(self.nPoint):
self.node[iPoint].updateCoordVel()


Expand Down