Skip to content
Snippets Groups Projects
Commit a3916106 authored by Thomée Corentin's avatar Thomée Corentin
Browse files

Removed IT_SOLVER_TOLERANCE, made the 1e-10 cleaner

parent a3a36402
No related branches found
No related tags found
No related merge requests found
......@@ -9,8 +9,7 @@ def initHSPM(cfg):
hspm = hspmw.HSPM()
hspm.chord = cfg['chord'] # Not optimal, but it will do for now
hspm.IT_SOLVER_TOLERANCE = cfg['it_solver_tolerance']
hspm.V_inf = 1 # Shouldn't have any impact on the solution (To verify)
hspm.V_inf = 1 # Shouldn't have any impact on the solution
hspm.AoA = np.deg2rad(cfg['aoa'])
if cfg['naca']:
......
......@@ -52,7 +52,6 @@ public:
Eigen::VectorXd b;
Eigen::VectorXd c;
double IT_SOLVER_TOLERANCE;
double tau;
Eigen::VectorXd s1;
Eigen::VectorXd s2;
......
......@@ -92,6 +92,27 @@ Eigen::MatrixXd HSPM::getSpeedAtPoint(double x_p, double y_p)
// Influence of the panels: A and B
for (size_t j=0; j<N; j++) {
// Check if we are on the panel
if (abs(x_p - x_m(j) < 1e-10) && abs(y_p - y_m(j)) < 1e-10) {
double _A_t = 0;
double _A_n = .5;
double _A_x = _A_t * cos(theta(j)) - _A_n * sin(theta(j));
double _A_y = _A_t * sin(theta(j)) + _A_n * cos(theta(j));
double _B_x = _A_y;
double _B_y = -_A_x;
// tau contribution
speeds(0,0) += _A_x * s1(j) + _B_x;
speeds(1,0) += _A_y * s1(j) + _B_y;
// constant contribution
speeds(0,1) += _A_x * s2(j);
speeds(1,1) += _A_y * s2(j);
continue;
}
double sine = sin(-theta(j));
double cosine = cos(-theta(j));
double r_p_jp1 = sqrt( pow(x_p - x(j+1), 2) + pow(y_p - y(j+1), 2) );
......
......@@ -42,10 +42,10 @@ void HSPM::solve()
}
double HSPM::solveOffBodyKutta() {
double xc_0 = x_m(0) - (dStar(0)+1e-10) * sin(theta(0));
double yc_0 = y_m(0) + (dStar(0)+1e-10) * cos(theta(0));
double xc_N1 = x_m(N-1) - (dStar(N-1)+1e-10) * sin(theta(N-1));
double yc_N1 = y_m(N-1) + (dStar(N-1)+1e-10) * cos(theta(N-1));
double xc_0 = x_m(0) - dStar(0) * sin(theta(0));
double yc_0 = y_m(0) + dStar(0) * cos(theta(0));
double xc_N1 = x_m(N-1) - dStar(N-1) * sin(theta(N-1));
double yc_N1 = y_m(N-1) + dStar(N-1) * cos(theta(N-1));
/*
The magnitude of the velocity at the control points is equal
......@@ -98,8 +98,8 @@ void HSPM::computeInviscidVelocity()
*/
for (size_t i=0; i<N; i++) {
double x_visc = x_m(i) - (dStar(i)+1e-10) * sin(theta(i));
double y_visc = y_m(i) + (dStar(i)+1e-10) * cos(theta(i));
double x_visc = x_m(i) - dStar(i) * sin(theta(i));
double y_visc = y_m(i) + dStar(i) * cos(theta(i));
Eigen::MatrixXd UV = this->getSpeedAtPoint(x_visc, y_visc);
......@@ -144,8 +144,8 @@ void HSPM::computePressureDistribution() {
/*
// Off body Cp, gives better graphs !
double x_visc = x_m(i) - (dStar(i)+1e-10) * sin(theta(i));
double y_visc = y_m(i) + (dStar(i)+1e-10) * cos(theta(i));
double x_visc = x_m(i) - dStar(i) * sin(theta(i));
double y_visc = y_m(i) + dStar(i) * cos(theta(i));
Eigen::MatrixXd UV = this->getSpeedAtPoint(x_visc, y_visc);
double _U = UV(0,0) * tau + UV(0,1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment