Skip to content

Commit f8da484

Browse files
author
Nicola-Fonzi
committed
Removed unnecessary output and condensed velocity initialisation
1 parent 7eb2270 commit f8da484

3 files changed

Lines changed: 10 additions & 32 deletions

File tree

SU2_CFD/src/python_wrapper_structure.cpp

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -915,41 +915,24 @@ void CSinglezoneDriver::SetInitialMesh() {
915915

916916
SU2_OMP_PARALLEL {
917917
// Overwrite fictious velocities
918-
SU2_OMP_FOR_STAT(omp_chunk_size)
919-
for (unsigned long iPoint = 0; iPoint < geometry_container[ZONE_0][INST_0][MESH_0]->GetnPointDomain(); iPoint++) {
920-
for (unsigned short iDim = 0; iDim < geometry_container[ZONE_0][INST_0][MESH_0]->GetnDim(); iDim++) {
921-
su2double GridVel = 0.0;
922-
geometry_container[ZONE_0][INST_0][MESH_0]->nodes->SetGridVel(iPoint, iDim, GridVel);
923-
}
924-
}
925-
926-
geometry_container[ZONE_0][INST_0][MESH_0]->InitiateComms(geometry_container[ZONE_0][INST_0][MESH_0], config_container[ZONE_0], GRID_VELOCITY);
927-
geometry_container[ZONE_0][INST_0][MESH_0]->CompleteComms(geometry_container[ZONE_0][INST_0][MESH_0], config_container[ZONE_0], GRID_VELOCITY);
928-
929-
for (iMesh = 1u; iMesh <= config_container[ZONE_0]->GetnMGLevels(); iMesh++) {
918+
for (iMesh = 0u; iMesh <= config_container[ZONE_0]->GetnMGLevels(); iMesh++) {
930919
SU2_OMP_FOR_STAT(roundUpDiv(geometry_container[ZONE_0][INST_0][iMesh]->GetnPoint(),omp_get_max_threads()))
931-
for (unsigned long Point_Coarse = 0; Point_Coarse < geometry_container[ZONE_0][INST_0][iMesh]->GetnPoint(); Point_Coarse++) {
920+
for (unsigned long iPoint = 0; iPoint < geometry_container[ZONE_0][INST_0][iMesh]->GetnPoint(); iPoint++) {
932921

933922
/*--- Overwrite fictitious velocities ---*/
934923
su2double Grid_Vel[3] = {0.0, 0.0, 0.0};
935924

936925
/*--- Set the grid velocity for this coarse node. ---*/
937-
for (unsigned short iDim = 0; iDim < geometry_container[ZONE_0][INST_0][MESH_0]->GetnDim(); iDim++)
938-
geometry_container[ZONE_0][INST_0][iMesh]->nodes->SetGridVel(Point_Coarse, iDim, Grid_Vel[iDim]);
926+
geometry_container[ZONE_0][INST_0][iMesh]->nodes->SetGridVel(iPoint, Grid_Vel);
939927
}
940-
}
941-
}
942-
943-
/*--- Push back the solution so that there is no fictious velocity at the next step. ---*/
944-
solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->Set_Solution_time_n();
945-
solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->Set_Solution_time_n1();
946-
947-
// Push back the volume
948-
for (iMesh = 0; iMesh <= config_container[ZONE_0]->GetnMGLevels(); iMesh++) {
928+
/*--- Push back the volume. ---*/
949929
geometry_container[ZONE_0][INST_0][iMesh]->nodes->SetVolume_n();
950930
geometry_container[ZONE_0][INST_0][iMesh]->nodes->SetVolume_nM1();
931+
}
932+
/*--- Push back the solution so that there is no fictious velocity at the next step. ---*/
933+
solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->Set_Solution_time_n();
934+
solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->Set_Solution_time_n1();
951935
}
952-
953936
}
954937

955938
void CFluidDriver::SetVertexTtotal(unsigned short iMarker, unsigned long iVertex, passivedouble val_Ttotal_passive){

SU2_CFD/src/solvers/CFEASolver.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,7 @@ void CFEASolver::BC_Sym_Plane(CGeometry *geometry, CNumerics *numerics, const CC
18431843
/*--- Set and enforce 0 solution for mesh deformation ---*/
18441844
nodes->SetBound_Disp(iPoint, axis, 0.0);
18451845
LinSysSol(iPoint, axis) = 0.0;
1846-
if (config->GetMarker_All_Deform_Mesh_Sym_Plane(val_marker) == NO){
1846+
if (LinSysReact.GetLocSize() > 0){
18471847
LinSysReact(iPoint, axis) = 0.0;
18481848
}
18491849
Jacobian.EnforceSolutionAtDOF(iPoint, axis, su2double(0.0), LinSysRes);
@@ -2784,11 +2784,6 @@ void CFEASolver::Solve_System(CGeometry *geometry, CConfig *config) {
27842784
/*--- Solve or smooth the linear system. ---*/
27852785

27862786
auto iter = System.Solve(Jacobian, LinSysRes, LinSysSol, geometry, config);
2787-
if (rank == MASTER_NODE){
2788-
if (iter >= config->GetDeform_Linear_Solver_Iter()){
2789-
cout<<"Reached maximum number of iterations in structural deformation solver"<<endl;
2790-
}
2791-
}
27922787

27932788
SU2_OMP_MASTER
27942789
{

SU2_PY/fsi_computation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def main():
118118
from SU2_Nastran import pysu2_nastran
119119
SolidSolver = pysu2_nastran.Solver(CSD_ConFile,True)
120120
else:
121-
print("\n I have no idea about the solid solver you want to use")
121+
print("\n Invalid solid solver option")
122122
else:
123123
SolidSolver = None
124124

0 commit comments

Comments
 (0)