Repository: fast-aircraft-design/FAST-OAD (language: python)

Issue:
Problem downloading other airfoil file with Xfoil
[profiles.zip](https://github.com/fast-aircraft-design/FAST-OAD/files/5560046/profiles.zip)

When I try to use another airfoil file than BACJ.txt, I encounter some problems.
To fix it on my FAST-GA I modified slightly the code...but I can revert to a newer version of FAST-OAD if it is corrected.
I would like also to return the profile object when doing get_profile and not return only profile.get_sides() -> that means a slight modification in xfoil_polar. The reason behind is the possibility to extract quickly the thickness ratio from profile for other functions I developed.

You will find attached my modifications of the profile/get_profile files and the airfoil file for the test.


[naca23012.txt](https://github.com/fast-aircraft-design/FAST-OAD/files/5560049/naca23012.txt)



Discussion / hints:

Fix patch:
diff --git a/src/fastoad/models/aerodynamics/external/xfoil/xfoil_polar.py b/src/fastoad/models/aerodynamics/external/xfoil/xfoil_polar.py
index fe26f9c19..b2e6c2472 100644
--- a/src/fastoad/models/aerodynamics/external/xfoil/xfoil_polar.py
+++ b/src/fastoad/models/aerodynamics/external/xfoil/xfoil_polar.py
@@ -27,7 +27,7 @@
 from openmdao.utils.file_wrap import InputFileGenerator
 
 from fastoad.models.aerodynamics.external.xfoil import xfoil699
-from fastoad.models.geometry.profiles.get_profile import get_profile
+from fastoad.models.geometry.profiles import get_profile
 from fastoad.utils.resource_management.copy import copy_resource
 from . import resources
 
@@ -114,7 +114,7 @@ def compute(self, inputs, outputs):
         tmp_profile_file_path = pth.join(tmp_directory.name, _TMP_PROFILE_FILE_NAME)
         profile = get_profile(
             file_name=self.options[OPTION_PROFILE_NAME], thickness_ratio=thickness_ratio
-        )
+        ).get_sides()
         np.savetxt(
             tmp_profile_file_path,
             profile.to_numpy(),
diff --git a/src/fastoad/models/geometry/profiles/__init__.py b/src/fastoad/models/geometry/profiles/__init__.py
index b42402a97..ddc128117 100644
--- a/src/fastoad/models/geometry/profiles/__init__.py
+++ b/src/fastoad/models/geometry/profiles/__init__.py
@@ -1,5 +1,5 @@
 """
-Different functions available
+Management of wing profiles
 """
 #  This file is part of FAST-OAD : A framework for rapid Overall Aircraft Design
 #  Copyright (C) 2020  ONERA & ISAE-SUPAERO
@@ -13,3 +13,5 @@
 #  GNU General Public License for more details.
 #  You should have received a copy of the GNU General Public License
 #  along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+from .get_profile import get_profile
diff --git a/src/fastoad/models/geometry/profiles/get_profile.py b/src/fastoad/models/geometry/profiles/get_profile.py
index aace1d60f..27a19b9f3 100644
--- a/src/fastoad/models/geometry/profiles/get_profile.py
+++ b/src/fastoad/models/geometry/profiles/get_profile.py
@@ -17,22 +17,21 @@
 from importlib.resources import open_text
 
 import numpy as np
-import pandas as pd
 
+from . import resources
 from .profile import Profile
-from .. import resources
 
 
-def get_profile(
-    file_name: str = "BACJ.txt", thickness_ratio=None, chord_length=None
-) -> pd.DataFrame:
+# FIXME: user currently has to know the name of available resources. A class would allow
+#        to provide more introspection.
+def get_profile(file_name: str = "BACJ.txt", chord_length=1.0, thickness_ratio=None) -> Profile:
     """
     Reads profile from indicated resource file and returns it after resize
 
-    :param file_name: name of resource (only "BACJ.txt" for now)
+    :param file_name: name of resource
+    :param chord_length: set to None to get original chord length
     :param thickness_ratio:
-    :param chord_length:
-    :return: Nx2 pandas.DataFrame with x in 1st column and z in 2nd column
+    :return: the Profile instance
     """
 
     with open_text(resources, file_name) as source:
@@ -46,4 +45,4 @@ def get_profile(
     if chord_length:
         profile.chord_length = chord_length
 
-    return profile.get_sides()
+    return profile
diff --git a/src/fastoad/models/geometry/profiles/profile.py b/src/fastoad/models/geometry/profiles/profile.py
index 54825a05c..fd6032d0a 100644
--- a/src/fastoad/models/geometry/profiles/profile.py
+++ b/src/fastoad/models/geometry/profiles/profile.py
@@ -63,7 +63,8 @@ def thickness_ratio(self) -> float:
     @thickness_ratio.setter
     def thickness_ratio(self, value: float):
 
-        # mean line is modified accordingly
+        # FIXME: mean line is modified accordingly to conform to legacy algorithm, but it
+        #        is questionable
         if self._max_relative_thickness != 0.0:
             coeff = value / self._max_relative_thickness
             self._rel_mean_line_and_thickness[Z] *= coeff
@@ -114,7 +115,7 @@ def get_relative_thickness(self) -> pd.DataFrame:
         """Point set of relative thickness of the profile.
 
         DataFrame keys are 'x' and 'thickness' and are relative to chord_length.
-        'x' is form 0. to 1.
+        'x' is from 0. to 1.
         """
         return self._rel_mean_line_and_thickness[[X, THICKNESS]] * [1.0, self.thickness_ratio]
 
@@ -166,7 +167,13 @@ def _compute_mean_line_and_thickness(
         Fills self._rel_mean_line_and_thickness with relative values.
         Returns actual chord length and maximum thickness (in meters)
         """
-        x = lower_side_points[X].append(upper_side_points[X]).drop_duplicates().sort_values()
+        x = (
+            lower_side_points[X]
+            .append(upper_side_points[X])
+            .sort_values()
+            .drop_duplicates()
+            .reset_index(drop=True)
+        )
 
         interp_lower = interp1d(lower_side_points[X], lower_side_points[Z], kind="quadratic")
         interp_upper = interp1d(upper_side_points[X], upper_side_points[Z], kind="quadratic")
@@ -184,8 +191,7 @@ def _compute_mean_line_and_thickness(
     @staticmethod
     def _create_upper_lower_sides(x: Sequence, z: Sequence) -> Tuple[pd.DataFrame, pd.DataFrame]:
         """ returns upper side points and lower side points using provided x and z """
-        # FIXME: leading and trailing edges are located roughly. For instance
-        #        thick trailing edges are not considered.
+        # FIXME: leading and trailing edges are located roughly.
         i_leading_edge = np.argmin(x)
         i_trailing_edge = np.argmax(x)
 
@@ -199,6 +205,14 @@ def _create_upper_lower_sides(x: Sequence, z: Sequence) -> Tuple[pd.DataFrame, p
         side1.sort_values(by=X, inplace=True)
         side2.sort_values(by=X, inplace=True)
 
+        # At this point, side2 and side1 have the same last point, but in in case of thick
+        # trailing edge, it could lead to side2 having 2 points for the same X, which will be
+        # harmful in next operations.
+        # In that case, we simply have to remove last point of side2, as it actually belongs to
+        # side1.
+        if side2[X].iloc[-1] == side2[X].iloc[-2]:
+            side2 = side2.iloc[:-1]
+
         if np.max(side1[Z]) > np.max(side2[Z]):
             upper_side_points = side1
             lower_side_points = side2
diff --git a/src/fastoad/models/geometry/resources/BACJ.txt b/src/fastoad/models/geometry/profiles/resources/BACJ.txt
similarity index 100%
rename from src/fastoad/models/geometry/resources/BACJ.txt
rename to src/fastoad/models/geometry/profiles/resources/BACJ.txt
diff --git a/src/fastoad/models/geometry/resources/__init__.py b/src/fastoad/models/geometry/profiles/resources/__init__.py
similarity index 100%
rename from src/fastoad/models/geometry/resources/__init__.py
rename to src/fastoad/models/geometry/profiles/resources/__init__.py
diff --git a/src/fastoad/models/geometry/profiles/resources/airfoil_f_15_11.txt b/src/fastoad/models/geometry/profiles/resources/airfoil_f_15_11.txt
new file mode 100644
index 000000000..a1979c3c0
--- /dev/null
+++ b/src/fastoad/models/geometry/profiles/resources/airfoil_f_15_11.txt
@@ -0,0 +1,144 @@
+F_15_11
+0.982282	0.0039361
+0.972993	0.00561631
+0.962804	0.0075065
+0.951736	0.00961317
+0.939812	0.0119471
+0.927052	0.0145421
+0.913486	0.017395
+0.899134	0.02041
+0.886635	0.023049
+0.877676	0.0249874
+0.864698	0.026948
+0.851320	0.0302312
+0.837666	0.0326018
+0.823134	0.0350006
+0.813777	0.0362775
+0.802576	0.0378028
+0.791255	0.0392705
+0.779843	0.0407031
+0.768365	0.0420819
+0.756849	0.0434243
+0.745409	0.0447214
+0.735302	0.0458445
+0.719635	0.0474983
+0.699358	0.0494262
+0.678095	0.0512315
+0.656511	0.0528771
+0.634645	0.0543619
+0.612542	0.0556766
+0.593635	0.0566434
+0.590243	0.0568172
+0.567792	0.0577773
+0.545233	0.0585561
+0.522610	0.0591576
+0.499970	0.0595871
+0.477352	0.0598527
+0.454803	0.0599565
+0.432368	0.0599036
+0.410088	0.0597003
+0.388010	0.0593507
+0.366171	0.0588609
+0.344621	0.0582382
+0.323398	0.0574908
+0.302546	0.0566208
+0.282100	0.0556333
+0.262105	0.0545387
+0.242601	0.053338
+0.236559	0.0529274
+0.223621	0.0520434
+0.208227	0.0508872
+0.199159	0.0501902
+0.185109	0.0489574
+0.169839	0.0475477
+0.154049	0.0459346
+0.138253	0.0441612
+0.123187	0.0422947
+0.113912	0.0410283
+0.104981	0.0397532
+0.092403	0.0378061
+0.082233	0.0361
+0.0703545	0.0338936
+0.059342	0.0315962
+0.0492105	0.0292002
+0.039984	0.0267339
+0.0316795	0.0242442
+0.024315	0.0217482
+0.017902	0.0191667
+0.0124545	0.0164068
+0.007984	0.01344
+0.004496	0.0102064
+0.001999	0.00670008
+0.0005005	0.00319001
+0	0
+0.0005005	-0.00313607
+0.001999	-0.00628226
+0.004496	-0.00919229
+0.007984	-0.0118111
+0.0124545	-0.0142868
+0.017902	-0.0168019
+0.024315	-0.0193829
+0.0316795	-0.0219531
+0.039984	-0.0244199
+0.0492105	-0.0267608
+0.059342	-0.0289979
+0.0703545	-0.0311307
+0.082233	-0.0331535
+0.092403	-0.0346823
+0.104981	-0.0364133
+0.113912	-0.0376253
+0.123187	-0.0388287
+0.138253	-0.0403936
+0.154049	-0.0418506
+0.169839	-0.043155
+0.185109	-0.0442736
+0.199159	-0.0451897
+0.208227	-0.0456947
+0.223621	-0.0465693
+0.236559	-0.0472235
+0.242601	-0.0475274
+0.262105	-0.048366
+0.282100	-0.0490768
+0.302546	-0.0496567
+0.323398	-0.0501016
+0.344621	-0.0504063
+0.366171	-0.0505544
+0.388010	-0.0505335
+0.410088	-0.0503219
+0.432368	-0.0499051
+0.454803	-0.0492668
+0.477352	-0.0483966
+0.499970	-0.0472946
+0.522610	-0.0459556
+0.545233	-0.0443847
+0.567792	-0.0425789
+0.590243	-0.0405547
+0.593635	-0.0402149
+0.612542	-0.0383203
+0.634645	-0.0358695
+0.656511	-0.0332044
+0.678095	-0.0303477
+0.699358	-0.0273291
+0.719635	-0.0242743
+0.735302	-0.0218101
+0.745409	-0.020214
+0.756849	-0.0184127
+0.768365	-0.0165933
+0.779843	-0.0147381
+0.791255	-0.0127457
+0.802576	-0.0108922
+0.813777	-0.00906936
+0.823134	-0.00757032
+0.837666	-0.00500382
+0.851320	-0.00279503
+0.864698	-0.00085973
+0.877676	0.00075888
+0.886635	0.00125564
+0.899134	0.00194202
+0.913486	0.00250521
+0.927052	0.00268696
+0.939812	0.00248921
+0.951736	0.00203602
+0.962804	0.00138699
+0.972993	0.00060898
+0.982282	-0.00025216
diff --git a/src/fastoad/models/geometry/profiles/resources/airfoil_f_15_12.txt b/src/fastoad/models/geometry/profiles/resources/airfoil_f_15_12.txt
new file mode 100644
index 000000000..0af37e1bb
--- /dev/null
+++ b/src/fastoad/models/geometry/profiles/resources/airfoil_f_15_12.txt
@@ -0,0 +1,144 @@
+F_15_12
+0.982282	0.00429237
+0.972993	0.00612467
+0.962804	0.00818597
+0.951736	0.0104833
+0.939812	0.0130285
+0.927052	0.0158584
+0.913486	0.0189696
+0.899134	0.0222574
+0.886635	0.0251353
+0.877676	0.0272492
+0.864698	0.0293872
+0.851320	0.0329677
+0.837666	0.0355528
+0.823134	0.0381687
+0.813777	0.0395613
+0.802576	0.0412245
+0.791255	0.0428251
+0.779843	0.0443874
+0.768365	0.045891
+0.756849	0.0473549
+0.745409	0.0487694
+0.735302	0.0499942
+0.719635	0.0517977
+0.699358	0.0539001
+0.678095	0.0558688
+0.656511	0.0576633
+0.634645	0.0592825
+0.612542	0.0607163
+0.593635	0.0617706
+0.590243	0.0619601
+0.567792	0.0630071
+0.545233	0.0638564
+0.522610	0.0645124
+0.499970	0.0649807
+0.477352	0.0652703
+0.454803	0.0653835
+0.432368	0.0653259
+0.410088	0.0651042
+0.388010	0.0647229
+0.366171	0.0641888
+0.344621	0.0635097
+0.323398	0.0626947
+0.302546	0.061746
+0.282100	0.0606691
+0.262105	0.0594753
+0.242601	0.058166
+0.236559	0.0577182
+0.223621	0.0567541
+0.208227	0.0554933
+0.199159	0.0547332
+0.185109	0.0533889
+0.169839	0.0518515
+0.154049	0.0500924
+0.138253	0.0481585
+0.123187	0.0461231
+0.113912	0.044742
+0.104981	0.0433515
+0.092403	0.0412281
+0.082233	0.0393677
+0.0703545	0.0369615
+0.059342	0.0344562
+0.0492105	0.0318432
+0.039984	0.0291537
+0.0316795	0.0264387
+0.024315	0.0237168
+0.017902	0.0209016
+0.0124545	0.0178919
+0.007984	0.0146566
+0.004496	0.0111302
+0.001999	0.00730655
+0.0005005	0.00347875
+0	0
+0.0005005	-0.00341994
+0.001999	-0.00685091
+0.004496	-0.0100243
+0.007984	-0.0128802
+0.0124545	-0.01558
+0.017902	-0.0183227
+0.024315	-0.0211373
+0.0316795	-0.0239402
+0.039984	-0.0266304
+0.0492105	-0.0291831
+0.059342	-0.0316227
+0.0703545	-0.0339485
+0.082233	-0.0361544
+0.092403	-0.0378216
+0.104981	-0.0397093
+0.113912	-0.041031
+0.123187	-0.0423433
+0.138253	-0.0440498
+0.154049	-0.0456388
+0.169839	-0.0470612
+0.185109	-0.0482811
+0.199159	-0.0492801
+0.208227	-0.0498308
+0.223621	-0.0507846
+0.236559	-0.051498
+0.242601	-0.0518294
+0.262105	-0.0527439
+0.282100	-0.053519
+0.302546	-0.0541514
+0.323398	-0.0546366
+0.344621	-0.0549689
+0.366171	-0.0551304
+0.388010	-0.0551076
+0.410088	-0.0548768
+0.432368	-0.0544224
+0.454803	-0.0537263
+0.477352	-0.0527773
+0.499970	-0.0515756
+0.522610	-0.0501154
+0.545233	-0.0484022
+0.567792	-0.046433
+0.590243	-0.0442255
+0.593635	-0.043855
+0.612542	-0.0417889
+0.634645	-0.0391162
+0.656511	-0.03621
+0.678095	-0.0330946
+0.699358	-0.0298029
+0.719635	-0.0264715
+0.735302	-0.0237843
+0.745409	-0.0220437
+0.756849	-0.0200793
+0.768365	-0.0180953
+0.779843	-0.0160721
+0.791255	-0.0138994
+0.802576	-0.0118781
+0.813777	-0.00989029
+0.823134	-0.00825556
+0.837666	-0.00545674
+0.851320	-0.00304803
+0.864698	-0.00093755
+0.877676	0.00082756
+0.886635	0.0013693
+0.899134	0.0021178
+0.913486	0.00273197
+0.927052	0.00293017
+0.939812	0.00271452
+0.951736	0.00222032
+0.962804	0.00151253
+0.972993	0.00066411
+0.982282	-0.00027499
diff --git a/src/fastoad/models/geometry/profiles/resources/airfoil_f_15_15.txt b/src/fastoad/models/geometry/profiles/resources/airfoil_f_15_15.txt
new file mode 100644
index 000000000..6da89d177
--- /dev/null
+++ b/src/fastoad/models/geometry/profiles/resources/airfoil_f_15_15.txt
@@ -0,0 +1,144 @@
+F_15_15
+0.982282	0.00765674
+0.972993	0.00536609
+0.962804	0.0102336
+0.951736	0.0131057
+0.939812	0.0162876
+0.927052	0.0198253
+0.913486	0.0237147
+0.899134	0.027825
+0.886635	0.0314228
+0.877676	0.0340655
+0.864698	0.0367383
+0.851320	0.0412143
+0.837666	0.0444461
+0.823134	0.0477165
+0.813777	0.0494573
+0.802576	0.0515366
+0.791255	0.0535376
+0.779843	0.0554906
+0.768365	0.0573704
+0.756849	0.0592005
+0.745409	0.0609689
+0.735302	0.0625
+0.719635	0.0647546
+0.699358	0.0673829
+0.678095	0.0698441
+0.656511	0.0720875
+0.634645	0.0741118
+0.612542	0.0759041
+0.593635	0.0772222
+0.590243	0.077459
+0.567792	0.078768
+0.545233	0.0798298
+0.522610	0.0806498
+0.499970	0.0812353
+0.477352	0.0815974
+0.454803	0.0817388
+0.432368	0.0816668
+0.410088	0.0813896
+0.388010	0.080913
+0.366171	0.0802453
+0.344621	0.0793963
+0.323398	0.0783775
+0.302546	0.0771914
+0.282100	0.0758451
+0.262105	0.0743528
+0.242601	0.0727158
+0.236559	0.0721561
+0.223621	0.0709509
+0.208227	0.0693746
+0.199159	0.0684244
+0.185109	0.0667438
+0.169839	0.0648219
+0.154049	0.0626228
+0.138253	0.0602051
+0.123187	0.0576606
+0.113912	0.055934
+0.104981	0.0541957
+0.092403	0.0515411
+0.082233	0.0492153
+0.0703545	0.0462072
+0.059342	0.0430752
+0.0492105	0.0398087
+0.039984	0.0364464
+0.0316795	0.0330522
+0.024315	0.0296494
+0.017902	0.0261301
+0.0124545	0.0223675
+0.007984	0.0183228
+0.004496	0.0139144
+0.001999	0.00913424
+0.0005005	0.00434895
+0	0
+0.0005005	-0.00427542
+0.001999	-0.00856463
+0.004496	-0.0125319
+0.007984	-0.0161021
+0.0124545	-0.0194773
+0.017902	-0.022906
+0.024315	-0.0264247
+0.0316795	-0.0299287
+0.039984	-0.0332918
+0.0492105	-0.0364831
+0.059342	-0.0395329
+0.0703545	-0.0424406
+0.082233	-0.0451982
+0.092403	-0.0472825
+0.104981	-0.0496424
+0.113912	-0.0512947
+0.123187	-0.0529353
+0.138253	-0.0550686
+0.154049	-0.0570551
+0.169839	-0.0588333
+0.185109	-0.0603584
+0.199159	-0.0616073
+0.208227	-0.0622957
+0.223621	-0.0634881
+0.236559	-0.0643799
+0.242601	-0.0647942
+0.262105	-0.0659375
+0.282100	-0.0669066
+0.302546	-0.0676971
+0.323398	-0.0683037
+0.344621	-0.0687191
+0.366171	-0.068921
+0.388010	-0.0688924
+0.410088	-0.0686039
+0.432368	-0.0680358
+0.454803	-0.0671656
+0.477352	-0.0659793
+0.499970	-0.0644769
+0.522610	-0.0626514
+0.545233	-0.0605098
+0.567792	-0.058048
+0.590243	-0.0552883
+0.593635	-0.0548252
+0.612542	-0.0522422
+0.634645	-0.048901
+0.656511	-0.0452677
+0.678095	-0.0413731
+0.699358	-0.0372579
+0.719635	-0.0330932
+0.735302	-0.0297338
+0.745409	-0.0275578
+0.756849	-0.0251021
+0.768365	-0.0226218
+0.779843	-0.0200925
+0.791255	-0.0173763
+0.802576	-0.0148494
+0.813777	-0.0123643
+0.823134	-0.0103206
+0.837666	-0.00682171
+0.851320	-0.00381048
+0.864698	-0.00117207
+0.877676	0.00103457
+0.886635	0.00171183
+0.899134	0.00264756
+0.913486	0.00341536
+0.927052	0.00366314
+0.939812	0.00339355
+0.951736	0.00277572
+0.962804	0.00189088
+0.972993	0.00083022
+0.982282	-0.00034378
diff --git a/src/fastoad/models/geometry/profiles/resources/naca23012.txt b/src/fastoad/models/geometry/profiles/resources/naca23012.txt
new file mode 100644
index 000000000..4a8b1e88f
--- /dev/null
+++ b/src/fastoad/models/geometry/profiles/resources/naca23012.txt
@@ -0,0 +1,62 @@
+NACA 23012
+1.00003	0.00126
+0.99730	0.00170
+0.98914	0.00302
+0.97563	0.00518
+0.95693	0.00812
+0.93324	0.01176
+0.90482	0.01602
+0.87197	0.02079
+0.83506	0.02597
+0.79449	0.03145
+0.75070	0.03712
+0.70417	0.04285
+0.65541	0.04854
+0.60496	0.05405
+0.55335	0.05924
+0.50117	0.06397
+0.44897	0.06811
+0.39733	0.07150
+0.34681	0.07402
+0.29796	0.07554
+0.25131	0.07597
+0.20738	0.07524
+0.16604	0.07320
+0.12732	0.06915
+0.09230	0.06265
+0.06203	0.05382
+0.03730	0.04324
+0.01865	0.03176
+0.00628	0.02030
+0.00015	0.00956
+0.00000	0.00000
+0.00533	-0.00792
+0.01557	-0.01401
+0.03029	-0.01870
+0.04915	-0.02248
+0.07195	-0.02586
+0.09868	-0.02922
+0.12954	-0.03282
+0.16483	-0.03660
+0.20483	-0.04016
+0.24869	-0.04283
+0.29531	-0.04446
+0.34418	-0.04510
+0.39476	-0.04482
+0.44650	-0.04371
+0.49883	-0.04188
+0.55117	-0.03945
+0.60296	-0.03655
+0.65360	-0.03327
+0.70257	-0.02975
+0.74930	-0.02607
+0.79330	-0.02235
+0.83407	-0.01866
+0.87118	-0.01512
+0.90420	-0.01180
+0.93279	-0.00880
+0.95661	-0.00621
+0.97543	-0.00410
+0.98901	-0.00254
+0.99722	-0.00158
+0.99997	-0.00126
diff --git a/src/fastoad/models/geometry/resources/airfoil_f_15_11.dat b/src/fastoad/models/geometry/resources/airfoil_f_15_11.dat
deleted file mode 100644
index 2dbd37aeb..000000000
--- a/src/fastoad/models/geometry/resources/airfoil_f_15_11.dat
+++ /dev/null
@@ -1,101 +0,0 @@
-50	
-0.00000000,0.00000000 
-0.00010100,0.00184222 
-0.00020000,0.00285106 
-0.00040000,0.00393666 
-0.00080100,0.00548390 
-0.00139900,0.00720441 
-0.00200000,0.00857511 
-0.00300100,0.01029671 
-0.00400000,0.01163452 
-0.00500100,0.01275301 
-0.00600000,0.01371798 
-0.00800000,0.01532993 
-0.01000000,0.01665786 
-0.01200000,0.01780816 
-0.01400000,0.01882796 
-0.01999900,0.02133908 
-0.02600100,0.02342255 
-0.03200100,0.02527574 
-0.04000000,0.02750176 
-0.05000000,0.02999205 
-0.06000000,0.03223890 
-0.06999900,0.03431140 
-0.08000100,0.03623039 
-0.10000000,0.03966262 
-0.12000000,0.04263431 
-0.14000100,0.04519039 
-0.16000000,0.04739338 
-0.19000100,0.05017865 
-0.22000000,0.05250336 
-0.26000000,0.05515704 
-0.30000000,0.05736222 
-0.35000100,0.05950052 
-0.40000100,0.06099074 
-0.44999900,0.06175834 
-0.49999900,0.06178136 
-0.54999900,0.06099074 
-0.59999900,0.05935687 
-0.64999900,0.05679091 
-0.70000000,0.05315143 
-0.74000000,0.04935732 
-0.78000000,0.04462018 
-0.81999900,0.03885117 
-0.85999900,0.03200863 
-0.90000000,0.02411338 
-0.92999900,0.01756691 
-0.95000000,0.01297232 
-0.96999900,0.00824724 
-0.97999900,0.00585564 
-0.99000000,0.00345417 
-1.00000000,0.00104173 
-0.00000000,0.00000000 
-0.00010100,-0.00177643 
-0.00020000,-0.00274140 
-0.00040000,-0.00388183 
-0.00080100,-0.00542688 
-0.00139900,-0.00711668 
-0.00200000,-0.00845449 
-0.00300100,-0.01025285 
-0.00400000,-0.01164438 
-0.00500100,-0.01293833 
-0.00600000,-0.01401296 
-0.00800000,-0.01579048 
-0.01000000,-0.01728071 
-0.01200000,-0.01850996 
-0.01400000,-0.01974797 
-0.01999900,-0.02278545 
-0.02600100,-0.02517705 
-0.03200100,-0.02731534 
-0.04000000,-0.02977054 
-0.05000000,-0.03239242 
-0.06000000,-0.03463928 
-0.06999900,-0.03657032 
-0.08000100,-0.03825793 
-0.10000000,-0.04100043 
-0.12000000,-0.04309376 
-0.14000100,-0.04476163 
-0.16000000,-0.04606654 
-0.19000100,-0.04760063 
-0.22000000,-0.04874215 
-0.26000000,-0.04978389 
-0.30000000,-0.05023348 
-0.35000100,-0.05031023 
-0.40000100,-0.04943189 
-0.44999900,-0.04756773 
-0.49999900,-0.04450943 
-0.54999900,-0.04012318 
-0.59999900,-0.03433224 
-0.64999900,-0.02730328 
-0.70000000,-0.01938611 
-0.74000000,-0.01311487 
-0.78000000,-0.00673179 
-0.81999900,-0.00144636 
-0.85999900,0.00234774 
-0.90000000,0.00425466 
-0.92999900,0.00432155 
-0.95000000,0.00366251 
-0.96999900,0.00245630 
-0.97999900,0.00163497 
-0.99000000,0.00066890 
-1.00000000,0.00104173
\ No newline at end of file
diff --git a/src/fastoad/models/geometry/resources/airfoil_f_15_12.dat b/src/fastoad/models/geometry/resources/airfoil_f_15_12.dat
deleted file mode 100644
index c74b094f2..000000000
--- a/src/fastoad/models/geometry/resources/airfoil_f_15_12.dat
+++ /dev/null
@@ -1,101 +0,0 @@
-50	
-0.00000000,0.00000000 
-0.00010100,0.00201359 
-0.00020000,0.00311627 
-0.00040000,0.00430286 
-0.00080100,0.00599403 
-0.00139900,0.00787459 
-0.00200000,0.00937279 
-0.00300100,0.01125454 
-0.00400000,0.01271680 
-0.00500100,0.01393933 
-0.00600000,0.01499407 
-0.00800000,0.01675597 
-0.01000000,0.01820743 
-0.01200000,0.01946473 
-0.01400000,0.02057940 
-0.01999900,0.02332411 
-0.02600100,0.02560139 
-0.03200100,0.02762697 
-0.04000000,0.03006006 
-0.05000000,0.03278201 
-0.06000000,0.03523787 
-0.06999900,0.03750316 
-0.08000100,0.03960066 
-0.10000000,0.04335217 
-0.12000000,0.04660029 
-0.14000100,0.04939415 
-0.16000000,0.05180207 
-0.19000100,0.05484643 
-0.22000000,0.05738739 
-0.26000000,0.06028792 
-0.30000000,0.06269824 
-0.35000100,0.06503545 
-0.40000100,0.06666430 
-0.44999900,0.06750330 
-0.49999900,0.06752847 
-0.54999900,0.06666430 
-0.59999900,0.06487843 
-0.64999900,0.06207379 
-0.70000000,0.05809574 
-0.74000000,0.05394870 
-0.78000000,0.04877089 
-0.81999900,0.04246523 
-0.85999900,0.03498617 
-0.90000000,0.02635649 
-0.92999900,0.01920104 
-0.95000000,0.01417905 
-0.96999900,0.00901442 
-0.97999900,0.00640035 
-0.99000000,0.00377549 
-1.00000000,0.00113864 
-0.00000000,0.00000000 
-0.00010100,-0.00194168 
-0.00020000,-0.00299642 
-0.00040000,-0.00424293 
-0.00080100,-0.00593171 
-0.00139900,-0.00777870 
-0.00200000,-0.00924095 
-0.00300100,-0.01120660 
-0.00400000,-0.01272758 
-0.00500100,-0.01414189 
-0.00600000,-0.01531649 
-0.00800000,-0.01725937 
-0.01000000,-0.01888822 
-0.01200000,-0.02023181 
-0.01400000,-0.02158499 
-0.01999900,-0.02490502 
-0.02600100,-0.02751910 
-0.03200100,-0.02985631 
-0.04000000,-0.03253990 
-0.05000000,-0.03540567 
-0.06000000,-0.03786153 
-0.06999900,-0.03997221 
-0.08000100,-0.04181681 
-0.10000000,-0.04481442 
-0.12000000,-0.04710249 
-0.14000100,-0.04892551 
-0.16000000,-0.05035180 
-0.19000100,-0.05202860 
-0.22000000,-0.05327631 
-0.26000000,-0.05441494 
-0.30000000,-0.05490636 
-0.35000100,-0.05499026 
-0.40000100,-0.05403020 
-0.44999900,-0.05199264 
-0.49999900,-0.04864984 
-0.54999900,-0.04385557 
-0.59999900,-0.03752594 
-0.64999900,-0.02984312 
-0.70000000,-0.02118947 
-0.74000000,-0.01433486 
-0.78000000,-0.00735800 
-0.81999900,-0.00158091 
-0.85999900,0.00256613 
-0.90000000,0.00465044 
-0.92999900,0.00472355 
-0.95000000,0.00400321 
-0.96999900,0.00268479 
-0.97999900,0.00178706 
-0.99000000,0.00073113 
-1.00000000,0.00113864
\ No newline at end of file
diff --git a/src/fastoad/models/geometry/resources/airfoil_f_15_15.dat b/src/fastoad/models/geometry/resources/airfoil_f_15_15.dat
deleted file mode 100644
index 986717317..000000000
--- a/src/fastoad/models/geometry/resources/airfoil_f_15_15.dat
+++ /dev/null
@@ -1,101 +0,0 @@
-50	
-0.00000000,0.00000000 
-0.00010100,0.00265623 
-0.00020000,0.00411083 
-0.00040000,0.00567611 
-0.00080100,0.00790702 
-0.00139900,0.01038775 
-0.00200000,0.01236411 
-0.00300100,0.01484642 
-0.00400000,0.01677535 
-0.00500100,0.01838806 
-0.00600000,0.01977942 
-0.00800000,0.02210362 
-0.01000000,0.02401831 
-0.01200000,0.02567688 
-0.01400000,0.02714729 
-0.01999900,0.03076798 
-0.02600100,0.03377205 
-0.03200100,0.03644409 
-0.04000000,0.03965370 
-0.05000000,0.04324435 
-0.06000000,0.04648400 
-0.06999900,0.04947226 
-0.08000100,0.05223916 
-0.10000000,0.05718797 
-0.12000000,0.06147272 
-0.14000100,0.06515824 
-0.16000000,0.06833464 
-0.19000100,0.07235061 
-0.22000000,0.07570252 
-0.26000000,0.07952875 
-0.30000000,0.08270832 
-0.35000100,0.08579144 
-0.40000100,0.08794014 
-0.44999900,0.08904690 
-0.49999900,0.08908010 
-0.54999900,0.08794014 
-0.59999900,0.08558432 
-0.64999900,0.08188457 
-0.70000000,0.07663694 
-0.74000000,0.07116637 
-0.78000000,0.06433607 
-0.81999900,0.05601796 
-0.85999900,0.04615197 
-0.90000000,0.03476814 
-0.92999900,0.02532904 
-0.95000000,0.01870428 
-0.96999900,0.01189137 
-0.97999900,0.00844301 
-0.99000000,0.00498043 
-1.00000000,0.00150203 
-0.00000000,0.00000000 
-0.00010100,-0.00256136 
-0.00020000,-0.00395272 
-0.00040000,-0.00559705 
-0.00080100,-0.00782481 
-0.00139900,-0.01026126 
-0.00200000,-0.01219019 
-0.00300100,-0.01478318 
-0.00400000,-0.01678958 
-0.00500100,-0.01865526 
-0.00600000,-0.02020473 
-0.00800000,-0.02276767 
-0.01000000,-0.02491637 
-0.01200000,-0.02668877 
-0.01400000,-0.02847382 
-0.01999900,-0.03285344 
-0.02600100,-0.03630179 
-0.03200100,-0.03938491 
-0.04000000,-0.04292497 
-0.05000000,-0.04670535 
-0.06000000,-0.04994500 
-0.06999900,-0.05272930 
-0.08000100,-0.05516260 
-0.10000000,-0.05911690 
-0.12000000,-0.06213520 
-0.14000100,-0.06454003 
-0.16000000,-0.06642153 
-0.19000100,-0.06863347 
-0.22000000,-0.07027938 
-0.26000000,-0.07178142 
-0.30000000,-0.07242966 
-0.35000100,-0.07254034 
-0.40000100,-0.07127389 
-0.44999900,-0.06858604 
-0.49999900,-0.06417638 
-0.54999900,-0.05785203 
-0.59999900,-0.04950230 
-0.64999900,-0.03936752 
-0.70000000,-0.02795206 
-0.74000000,-0.01890982 
-0.78000000,-0.00970630 
-0.81999900,-0.00208546 
-0.85999900,0.00338511 
-0.90000000,0.00613462 
-0.92999900,0.00623107 
-0.95000000,0.00528084 
-0.96999900,0.00354164 
-0.97999900,0.00235740 
-0.99000000,0.00096446 
-1.00000000,0.00150203
\ No newline at end of file
diff --git a/src/fastoad/models/weight/cg/cg_components/compute_cg_tanks.py b/src/fastoad/models/weight/cg/cg_components/compute_cg_tanks.py
index ad769e904..d3a643747 100644
--- a/src/fastoad/models/weight/cg/cg_components/compute_cg_tanks.py
+++ b/src/fastoad/models/weight/cg/cg_components/compute_cg_tanks.py
@@ -16,13 +16,12 @@
 #  along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 import math
-from importlib.resources import open_text
 
 import numpy as np
 from openmdao.core.explicitcomponent import ExplicitComponent
 from scipy import interpolate
 
-from fastoad.models.geometry import resources
+from fastoad.models.geometry.profiles import get_profile
 
 
 class ComputeTanksCG(ExplicitComponent):
@@ -60,12 +59,6 @@ def setup(self):
     def compute(self, inputs, outputs):
 
         # TODO: decompose into a function to make the code more clear
-        x_up = []
-        x_down = []
-        y_up = []
-        y_down = []
-        xy_up = []
-        xy_down = []
         front_spar_ratio_root = inputs["data:geometry:wing:spar_ratio:front:root"]
         front_spar_ratio_kink = inputs["data:geometry:wing:spar_ratio:front:kink"]
         front_spar_ratio_tip = inputs["data:geometry:wing:spar_ratio:front:tip"]
@@ -85,82 +78,18 @@ def compute(self, inputs, outputs):
         fa_length = inputs["data:geometry:wing:MAC:at25percent:x"]
         width_max = inputs["data:geometry:fuselage:maximum_width"]
 
-        airfoil_file = open_text(resources, "airfoil_f_15_15.dat")
-        node_number = int(airfoil_file.readline())
-        for _ in range(1, node_number):
-            line = airfoil_file.readline()
-            xy_up.append([float(xy) for xy in line.split(",")])
-        for _ in range(node_number + 1):
-            line = airfoil_file.readline()
-            xy_down.append([float(xy) for xy in line.split(",")])
-        airfoil_file.close()
-        for xy_u in xy_up:
-            x_up.append(xy_u[0])
-            y_up.append(xy_u[1])
-        for xy_d in xy_down:
-            x_down.append(xy_d[0])
-            y_down.append(xy_d[1])
-        y_up_root_front = interpolate.interp1d(x_up, y_up)(front_spar_ratio_root)
-        y_down_root_front = interpolate.interp1d(x_down, y_down)(front_spar_ratio_root)
-        y_up_root_rear = interpolate.interp1d(x_up, y_up)(rear_spar_ratio_root)
-        y_down_root_rear = interpolate.interp1d(x_down, y_down)(rear_spar_ratio_root)
-        height_root_front = (y_up_root_front - y_down_root_front) * l2_wing
-        height_root_rear = (y_up_root_rear - y_down_root_rear) * l2_wing
-        x_up = []
-        x_down = []
-        y_up = []
-        y_down = []
-        xy_up = []
-        xy_down = []
-        airfoil_file = open_text(resources, "airfoil_f_15_12.dat")
-        node_number = int(airfoil_file.readline())
-        for _ in range(1, node_number):
-            line = airfoil_file.readline()
-            xy_up.append([float(xy) for xy in line.split(",")])
-        for _ in range(node_number + 1):
-            line = airfoil_file.readline()
-            xy_down.append([float(xy) for xy in line.split(",")])
-        airfoil_file.close()
-        for xy_u in xy_up:
-            x_up.append(xy_u[0])
-            y_up.append(xy_u[1])
-        for xy_d in xy_down:
-            x_down.append(xy_d[0])
-            y_down.append(xy_d[1])
-        y_up_kink_front = interpolate.interp1d(x_up, y_up)(front_spar_ratio_kink)
-        y_down_kink_front = interpolate.interp1d(x_down, y_down)(front_spar_ratio_kink)
-        y_up_kink_rear = interpolate.interp1d(x_up, y_up)(rear_spar_ratio_kink)
-        y_down_kink_rear = interpolate.interp1d(x_down, y_down)(rear_spar_ratio_kink)
-        height_kink_front = (y_up_kink_front - y_down_kink_front) * l3_wing
-        height_kink_rear = (y_up_kink_rear - y_down_kink_rear) * l3_wing
-
-        x_up = []
-        x_down = []
-        y_up = []
-        y_down = []
-        xy_up = []
-        xy_down = []
-        airfoil_file = open_text(resources, "airfoil_f_15_11.dat")
-        node_number = int(airfoil_file.readline())
-        for _ in range(1, node_number):
-            line = airfoil_file.readline()
-            xy_up.append([float(xy) for xy in line.split(",")])
-        for _ in range(node_number + 1):
-            line = airfoil_file.readline()
-            xy_down.append([float(xy) for xy in line.split(",")])
-        airfoil_file.close()
-        for xy_u in xy_up:
-            x_up.append(xy_u[0])
-            y_up.append(xy_u[1])
-        for xy_d in xy_down:
-            x_down.append(xy_d[0])
-            y_down.append(xy_d[1])
-        y_up_tip_front = interpolate.interp1d(x_up, y_up)(front_spar_ratio_tip)
-        y_down_tip_front = interpolate.interp1d(x_down, y_down)(front_spar_ratio_tip)
-        y_up_tip_rear = interpolate.interp1d(x_up, y_up)(rear_spar_ratio_tip)
-        y_down_tip_rear = interpolate.interp1d(x_down, y_down)(rear_spar_ratio_tip)
-        height_tip_front = (y_up_tip_front - y_down_tip_front) * l4_wing
-        height_tip_rear = (y_up_tip_rear - y_down_tip_rear) * l4_wing
+        profile = get_profile("airfoil_f_15_15.txt", chord_length=1.0)
+        height_root_front, height_root_rear = self._get_thickness(
+            profile, l2_wing, [front_spar_ratio_root, rear_spar_ratio_root]
+        )
+        profile = get_profile("airfoil_f_15_12.txt", chord_length=1.0)
+        height_kink_front, height_kink_rear = self._get_thickness(
+            profile, l3_wing, [front_spar_ratio_root, rear_spar_ratio_root]
+        )
+        profile = get_profile("airfoil_f_15_11.txt", chord_length=1.0)
+        height_tip_front, height_tip_rear = self._get_thickness(
+            profile, l4_wing, [front_spar_ratio_root, rear_spar_ratio_root]
+        )
 
         l_root = l2_wing * (rear_spar_ratio_root - front_spar_ratio_root)
         l_kink = l3_wing * (rear_spar_ratio_kink - front_spar_ratio_kink)
@@ -173,7 +102,7 @@ def compute(self, inputs, outputs):
         vol_side_inner = (
             (s_root + s_kink + math.sqrt(s_root * s_kink)) * (y3_wing - y2_wing) * 2 / 3
         )
-        # Assume in the region ourward 0.8 of the span, no tank installed
+        # Assume in the region outward 0.8 of the span, no tank installed
         ratio_1 = y4_wing * self.ratio / (y4_wing - y3_wing)
         s_real_tip = (ratio_1 * (s_kink ** 0.5 - s_tip ** 0.5) + s_tip ** 0.5) ** 2
         vol_side_out = (
@@ -268,3 +197,17 @@ def compute(self, inputs, outputs):
         # (vol_side_out*0.8+vol_side_inner*0.8+vol_central*0.8)
 
         outputs["data:weight:fuel_tank:CG:x"] = x_cg_tank
+
+    @staticmethod
+    def _get_thickness(profile, l2_wing, relative_x):
+        """
+
+        :param profile:
+        :param l2_wing:
+        :param relative_x:
+        :return: profile thickness at provide value(s) of relative_x
+        """
+        relative_thickness = profile.get_relative_thickness()
+        relative_x_scale = relative_thickness.x
+        thickness = relative_thickness.thickness * l2_wing
+        return interpolate.interp1d(relative_x_scale, thickness)(relative_x)


Test patch:
diff --git a/src/fastoad/models/geometry/profiles/tests/__init__.py b/src/fastoad/models/geometry/profiles/tests/__init__.py
new file mode 100644
index 000000000..94845a3e6
--- /dev/null
+++ b/src/fastoad/models/geometry/profiles/tests/__init__.py
@@ -0,0 +1,12 @@
+#  This file is part of FAST-OAD : A framework for rapid Overall Aircraft Design
+#  Copyright (C) 2020  ONERA & ISAE-SUPAERO
+#  FAST is free software: you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation, either version 3 of the License, or
+#  (at your option) any later version.
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#  You should have received a copy of the GNU General Public License
+#  along with this program.  If not, see <https://www.gnu.org/licenses/>.
diff --git a/src/fastoad/models/geometry/tests/test_profile.py b/src/fastoad/models/geometry/profiles/tests/test_profile.py
similarity index 59%
rename from src/fastoad/models/geometry/tests/test_profile.py
rename to src/fastoad/models/geometry/profiles/tests/test_profile.py
index ab5720494..f782e290a 100644
--- a/src/fastoad/models/geometry/tests/test_profile.py
+++ b/src/fastoad/models/geometry/profiles/tests/test_profile.py
@@ -17,7 +17,8 @@
 from numpy.testing import assert_allclose
 
 # pylint: disable=redefined-outer-name  # false positive on pytest fixtures
-from ..profiles.profile import Profile
+from ..get_profile import get_profile
+from ..profile import Profile
 
 
 @pytest.fixture()
@@ -137,27 +138,27 @@ def test_set_points(point_set):
     # Direct initialization from point set
     profile = Profile()
     profile.set_points(x * 2.5, z * 2.5)
-    assert_allclose(2.5, profile.chord_length, rtol=1e-4)
-    assert_allclose(0.10070, profile.thickness_ratio, rtol=1e-4)
+    assert_allclose(profile.chord_length, 2.5, rtol=1e-4)
+    assert_allclose(profile.thickness_ratio, 0.10070, rtol=1e-4)
 
     # Initialization after having set chord length
     profile = Profile()
     profile.chord_length = 0.5
     profile.set_points(x, z)
-    assert_allclose(0.5, profile.chord_length, rtol=1e-4)
-    assert_allclose(0.10070, profile.thickness_ratio, rtol=1e-4)
+    assert_allclose(profile.chord_length, 0.5, rtol=1e-4)
+    assert_allclose(profile.thickness_ratio, 0.10070, rtol=1e-4)
 
     # Initialization after having set relative thickness
     profile = Profile()
     profile.thickness_ratio = 0.2
     profile.set_points(x * 1.5, z)
-    assert_allclose(1.5, profile.chord_length, rtol=1e-4)
-    assert_allclose(0.2, profile.thickness_ratio, rtol=1e-4)
+    assert_allclose(profile.chord_length, 1.5, rtol=1e-4)
+    assert_allclose(profile.thickness_ratio, 0.2, rtol=1e-4)
 
     # Setting points while explicitly ignoring previous chord length and thickness
     profile.set_points(x, z, False, False)
-    assert_allclose(1.0, profile.chord_length, rtol=1e-4)
-    assert_allclose(0.10070, profile.thickness_ratio, rtol=1e-4)
+    assert_allclose(profile.chord_length, 1.0, rtol=1e-4)
+    assert_allclose(profile.thickness_ratio, 0.10070, rtol=1e-4)
 
     # Check relative thickness distribution
     relative_thickness = profile.get_relative_thickness()
@@ -165,9 +166,80 @@ def test_set_points(point_set):
     assert_allclose(1.0, np.max(relative_thickness["x"]), rtol=1e-4)
     assert_allclose(0.10070, np.max(relative_thickness["thickness"]), rtol=1e-4)
 
+    # # Activate this part to get a visual check of the interpolation
     # import matplotlib.pyplot as plt
     # plt.axes(aspect='equal')
     # plt.plot(profile.get_upper_side()['x'], profile.get_upper_side()['z'], 'o-')
     # plt.plot(profile.get_lower_side()['x'], profile.get_lower_side()['z'], 'o-')
     # plt.plot(profile.get_mean_line()['x'], profile.get_mean_line()['z'], 'o-')
     # plt.show()
+
+
+def test_get_profile():
+    # Default profile ("BACJ.txt")
+    profile = get_profile()
+    assert_allclose(profile.chord_length, 1.0, rtol=1e-4)
+    assert_allclose(profile.thickness_ratio, 0.10070, rtol=1e-4)
+    upper = profile.get_upper_side()
+    lower = profile.get_lower_side()
+    for vect in [upper, lower]:
+        assert_allclose(np.min(vect.x), 0.0)
+        assert_allclose(np.max(vect.x), 1.0)
+    thickness = profile.get_relative_thickness()
+    assert_allclose(np.max(thickness.thickness), 0.10070, rtol=1e-4)
+
+    # Profile where original chord length is not 1.0
+    profile = get_profile("airfoil_f_15_15.txt")
+    assert_allclose(profile.chord_length, 1.0, rtol=1e-4)
+    assert_allclose(profile.thickness_ratio, 0.1527, rtol=1e-4)
+    upper = profile.get_upper_side()
+    lower = profile.get_lower_side()
+    for vect in [upper, lower]:
+        assert_allclose(np.min(vect.x), 0.0)
+        assert_allclose(np.max(vect.x), 1.0)
+    thickness = profile.get_relative_thickness()
+    assert_allclose(np.max(thickness.thickness), 0.1527, rtol=1e-4)
+
+    # Ask for original chord length
+    profile = get_profile("airfoil_f_15_15.txt", chord_length=None)
+    assert_allclose(profile.chord_length, 0.9823, rtol=1e-4)
+    assert_allclose(profile.thickness_ratio, 0.1527, rtol=1e-4)
+    upper = profile.get_upper_side()
+    lower = profile.get_lower_side()
+    for vect in [upper, lower]:
+        assert_allclose(np.min(vect.x), 0.0)
+        assert_allclose(np.max(vect.x), 0.9823, rtol=1e-4)
+    thickness = profile.get_relative_thickness()
+    assert_allclose(np.max(thickness.thickness), 0.1527, rtol=1e-4)
+
+    profile = get_profile("airfoil_f_15_12.txt", chord_length=None)
+    assert_allclose(profile.chord_length, 0.9823, rtol=1e-4)
+    assert_allclose(profile.thickness_ratio, 0.12215, rtol=1e-4)
+
+    profile = get_profile("airfoil_f_15_11.txt", chord_length=None)
+    assert_allclose(profile.chord_length, 0.9823, rtol=1e-4)
+    assert_allclose(profile.thickness_ratio, 0.1120, rtol=1e-4)
+
+    # Modification of chord length and thickness
+    profile = get_profile("airfoil_f_15_12.txt", chord_length=0.5, thickness_ratio=0.2)
+    assert_allclose(profile.chord_length, 0.5, rtol=1e-4)
+    assert_allclose(profile.thickness_ratio, 0.2, rtol=1e-4)
+    upper = profile.get_upper_side()
+    lower = profile.get_lower_side()
+    for vect in [upper, lower]:
+        assert_allclose(np.min(vect.x), 0.0)
+        assert_allclose(np.max(vect.x), 0.5, rtol=1e-4)
+    thickness = profile.get_relative_thickness()
+    assert_allclose(np.max(thickness.thickness), 0.2, rtol=1e-4)
+
+    # Profile with thick trailing edge
+    profile = get_profile("naca23012.txt")
+    assert_allclose(profile.chord_length, 1.0, rtol=1e-4)
+    assert_allclose(profile.thickness_ratio, 0.12006, rtol=1e-4)
+    upper = profile.get_upper_side()
+    lower = profile.get_lower_side()
+    for vect in [upper, lower]:
+        assert_allclose(np.min(vect.x), 0.0)
+        assert_allclose(np.max(vect.x), 1.0, rtol=1e-4)
+    thickness = profile.get_relative_thickness()
+    assert_allclose(np.max(thickness.thickness), 0.12006, rtol=1e-4)
diff --git a/src/fastoad/models/weight/cg/tests/test_geometry_cg_components.py b/src/fastoad/models/weight/cg/tests/test_geometry_cg_components.py
index 02763a1e4..6f0b9d43c 100644
--- a/src/fastoad/models/weight/cg/tests/test_geometry_cg_components.py
+++ b/src/fastoad/models/weight/cg/tests/test_geometry_cg_components.py
@@ -350,7 +350,7 @@ def test_compute_cg_tanks(input_xml):
     problem = run_system(ComputeTanksCG(), input_vars)
 
     x_cg_tank = problem["data:weight:fuel_tank:CG:x"]
-    assert x_cg_tank == pytest.approx(16.05, abs=1e-2)
+    assert x_cg_tank == pytest.approx(16.12, abs=1e-2)
 
 
 def test_compute_cg_wing(input_xml):