-
Notifications
You must be signed in to change notification settings - Fork 1
adjusting tests, to accomodate new and higher drag predictions of vsm… #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -108,10 +108,10 @@ def test_v3(): | |
| is_plotting=False, | ||
| ) | ||
|
|
||
| # assert np.allclose(CL_LLT, CL_LLT_new, atol=1e-2) | ||
| # assert np.allclose(CD_LLT, CD_LLT_new, atol=1e-2) | ||
| assert np.allclose(CL_LLT, CL_LLT_new, atol=1e-2) | ||
| assert np.allclose(CD_LLT, CD_LLT_new, atol=1e-2) | ||
| assert np.allclose(CL_VSM, CL_VSM_new, atol=1e-2) | ||
| assert np.allclose(CD_VSM, CD_VSM_new, atol=1e-3) | ||
| # assert np.allclose(CD_VSM, CD_VSM_new, atol=1e-3) | ||
|
|
||
| # --- POLYNOMIAL CASE --- | ||
| case_params = get_v3_case_params() | ||
|
|
@@ -140,7 +140,7 @@ def test_v3(): | |
| assert np.allclose(CL_LLT, CL_LLT_new, atol=1e-2) | ||
| assert np.allclose(CD_LLT, CD_LLT_new, atol=1e-2) | ||
| assert np.allclose(CL_VSM, CL_VSM_new, atol=1e-2) | ||
| assert np.allclose(CD_VSM, CD_VSM_new, atol=1e-3) | ||
| # assert np.allclose(CD_VSM, CD_VSM_new, atol=1e-3) | ||
|
||
|
|
||
| # comparing solution | ||
| CL_struts = np.loadtxt("./CFD_data/RANS_CL_alpha_struts.csv", delimiter=",") | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -109,7 +109,7 @@ def test_curved(): | |||||||||||||||||
|
|
||||||||||||||||||
| # checking VSMs to be close to one another | ||||||||||||||||||
| assert np.allclose(CL_VSM, CL_VSM_new, atol=4e-2) | ||||||||||||||||||
| assert np.allclose(CD_VSM, CD_VSM_new, atol=4e-3) | ||||||||||||||||||
| # assert np.allclose(CD_VSM, CD_VSM_new, atol=4e-3) | ||||||||||||||||||
|
||||||||||||||||||
|
|
||||||||||||||||||
| # checking the LLT to be close to the VSM, with HIGHER tolerance | ||||||||||||||||||
| tol_llt_to_vsm_CL = 2e-1 | ||||||||||||||||||
|
|
@@ -129,7 +129,7 @@ def test_curved(): | |||||||||||||||||
|
|
||||||||||||||||||
| # checking new VSM close to Maneia | ||||||||||||||||||
|
||||||||||||||||||
| # checking new VSM close to Maneia | |
| # checking new VSM close to Maneia | |
| # NOTE: The tolerance here was relaxed from 1e-2 to 1e-1 on purpose. | |
| # The updated VSM formulation (e.g. wake alignment / discretisation changes) | |
| # leads to small but systematic differences in CL/CD relative to Maneia's data, | |
| # and the published polars themselves have experimental/numerical uncertainty. | |
| # A 1e-1 absolute tolerance still enforces physically consistent behaviour and | |
| # matching trends, while avoiding fragile test failures after the VSM changes. |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -93,19 +93,19 @@ def test_elliptical(): | |||||||||||
|
|
||||||||||||
| # checking VSMs to be close to one another | ||||||||||||
| assert np.allclose(CL_VSM, CL_VSM_new, atol=1e-2) | ||||||||||||
| assert np.allclose(CD_VSM, CD_VSM_new, atol=1e-3) | ||||||||||||
| # assert np.allclose(CD_VSM, CD_VSM_new, atol=1e-3) | ||||||||||||
|
||||||||||||
|
|
||||||||||||
| # checking the LLT to be close to the VSM, with HIGHER tolerance | ||||||||||||
| tol_llt_to_vsm_CL = 1e-1 | ||||||||||||
| tol_llt_to_vsm_CD = 1e-3 | ||||||||||||
| assert np.allclose(CL_th, CL_VSM, atol=tol_llt_to_vsm_CL) | ||||||||||||
| assert np.allclose(CDi_th, CD_VSM, atol=tol_llt_to_vsm_CD) | ||||||||||||
| assert np.allclose(CL_th, CL_VSM_new, atol=tol_llt_to_vsm_CL) | ||||||||||||
|
||||||||||||
| assert np.allclose(CL_th, CL_VSM_new, atol=tol_llt_to_vsm_CL) | |
| assert np.allclose(CL_th, CL_VSM_new, atol=tol_llt_to_vsm_CL) | |
| # VSM refactor (projected AR / paneling) introduces slightly larger scatter in CDi; | |
| # keep the LLT↔VSM CD tolerance but relax it by a factor 2 for the new VSM to avoid | |
| # flaky failures while still catching meaningful regressions. |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tolerance has been changed from the variable 'tol_llt_to_vsm_CD' to a hardcoded value of 1e-2 without explanation. This creates inconsistency - consider either updating the variable's value or adding a comment explaining why a different tolerance is needed here compared to line 106.
| assert np.allclose(CD_LLT_new, CD_VSM_new, atol=1e-2) | |
| # Use a looser tolerance for the new LLT vs new VSM CD comparison to | |
| # account for expected numerical differences between implementations. | |
| assert np.allclose(CD_LLT_new, CD_VSM_new, atol=10 * tol_llt_to_vsm_CD) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -112,13 +112,13 @@ def test_swept_wing(): | |
|
|
||
| # checking VSMs to be close to one another | ||
| assert np.allclose(CL_VSM, CL_VSM_new, atol=4e-2) | ||
| assert np.allclose(CD_VSM, CD_VSM_new, atol=4e-3) | ||
| # assert np.allclose(CD_VSM, CD_VSM_new, atol=4e-3) | ||
|
||
|
|
||
| # checking the LLT to be close to the VSM, with HIGHER tolerance | ||
| tol_llt_to_vsm_CL = 2e-1 | ||
| tol_llt_to_vsm_CD = 4e-2 | ||
| assert np.allclose(CL_LLT, CL_VSM, atol=tol_llt_to_vsm_CL) | ||
| assert np.allclose(CD_LLT, CD_VSM, atol=tol_llt_to_vsm_CD) | ||
| # assert np.allclose(CD_LLT, CD_VSM, atol=tol_llt_to_vsm_CD) | ||
|
||
| assert np.allclose(CL_LLT_new, CL_VSM_new, atol=tol_llt_to_vsm_CL) | ||
| assert np.allclose(CD_LLT_new, CD_VSM_new, atol=tol_llt_to_vsm_CD) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assertion has been commented out, which reduces test coverage for drag coefficient verification between old and new VSM implementations. Consider either removing the assertion entirely if it's no longer valid, or updating the tolerance to reflect the new VSM behavior instead of commenting it out.