From 68d63db8617c00fff32a6476a17076eae270f08a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20Thom=C3=A9e?= <corentin.thomee@student.uliege.be> Date: Tue, 9 Apr 2024 10:26:53 +0200 Subject: [PATCH] Added parameters for wake definition --- hspm/api/core.py | 10 ++++++++++ hspm/src/hspm.cpp | 7 ++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/hspm/api/core.py b/hspm/api/core.py index fd21cc3..7905e39 100644 --- a/hspm/api/core.py +++ b/hspm/api/core.py @@ -39,6 +39,16 @@ def initHSPM(cfg): cfg['aoa'] = 0 hspm.AoA = np.deg2rad(cfg['aoa']) + if not 'N_wake' in cfg: + print("HSPM Warning: N_wake not defined. Using default value of 100") + cfg['N_wake'] = 100 + hspm.N_wake = cfg['N_wake'] + + if not 'L_wake' in cfg: + print("HSPM Warning: L_wake not defined. Using default value of 5") + cfg['L_wake'] = 5 + hspm.L_wake = cfg['L_wake'] + if not "meshType" in cfg: print("HSPM Warning: meshType not defined. Using default cosine mesh (CosN)") cfg['meshType'] = "CosN" diff --git a/hspm/src/hspm.cpp b/hspm/src/hspm.cpp index 55bc9e8..832e73d 100644 --- a/hspm/src/hspm.cpp +++ b/hspm/src/hspm.cpp @@ -17,11 +17,12 @@ void HSPM::initHSPM() V_y = V_inf * sin(AoA); - // TODO: Temporary - this->L_wake = 3 * chord; - this->N_wake = 100; + // TODO: Move somewhere else this->x_wake = Eigen::VectorXd::LinSpaced(N_wake+1, chord, L_wake+chord); this->y_wake = Eigen::VectorXd::Zero(N_wake+1); + for (size_t i=0; i<N_wake+1; i++) { + y_wake(i) = (x_wake(i)-chord) * tan(AoA); + } this->x_m_wake = Eigen::VectorXd::Zero(N_wake); this->y_m_wake = Eigen::VectorXd::Zero(N_wake); for (size_t i=0; i<N_wake; i++) { -- GitLab