Skip to content

Commit 21b1cb6

Browse files
committed
fix: switch OSWEC solver from SPARSE_QR to GMRES to prevent divergence
SPARSE_QR causes the OSWEC model to blow up. GMRES is stable for all OSWEC cases (decay and regular waves).
1 parent 51cd5cd commit 21b1cb6

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

demos/oswec/demo_oswec_decay.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ int main(int argc, char* argv[]) {
8888
system.SetGravitationalAcceleration(ChVector3d(0.0, 0.0, -9.81));
8989
double timestep = 0.03;
9090
// system.SetTimestepperType(ChTimestepper::Type::HHT);
91-
system.SetSolverType(ChSolver::Type::SPARSE_QR);
91+
system.SetSolverType(ChSolver::Type::GMRES);
9292
// system.GetSolver()->AsIterative()->SetMaxIterations(300); // the higher, the easier to keep the constraints
9393
// satisfied.
9494
ChRealtimeStepTimer realtime_timer;

demos/oswec/demo_oswec_reg_waves.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ int main(int argc, char* argv[]) {
9595
system.SetGravitationalAcceleration(ChVector3d(0.0, 0.0, -9.81));
9696
double timestep = 0.03;
9797
// system.SetTimestepperType(ChTimestepper::Type::HHT);
98-
system.SetSolverType(ChSolver::Type::SPARSE_QR);
98+
system.SetSolverType(ChSolver::Type::GMRES);
9999
// system.GetSolver()->AsIterative()->SetMaxIterations(300);
100100
ChRealtimeStepTimer realtime_timer;
101101
double simulationDuration = 1000.0;

tests/regression/oswec/test_oswec_decay.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ int main(int argc, char* argv[]) {
6565

6666
system.SetGravitationalAcceleration(ChVector3d(0.0, 0.0, -9.81));
6767
double timestep = 0.03;
68-
system.SetSolverType(ChSolver::Type::SPARSE_QR);
68+
system.SetSolverType(ChSolver::Type::GMRES);
6969
double simulationDuration = 400.0;
7070

7171
// Output timeseries

tests/regression/oswec/test_oswec_reg_waves.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ int main(int argc, char* argv[]) {
3737

3838
system.SetGravitationalAcceleration(ChVector3d(0.0, 0.0, -9.81));
3939
double timestep = 0.03;
40-
system.SetSolverType(ChSolver::Type::SPARSE_QR);
40+
system.SetSolverType(ChSolver::Type::GMRES);
4141
double simulationDuration = 240.0;
4242

4343
// Output timeseries

0 commit comments

Comments
 (0)