**Short note on CST method for airfoil parameterization ( MATLAB Code included)**

The Class Shape Transformation (CST) parameterization method was first developed by Brenda Kulfan, an aerodynamic engineer at Boeing. So what’s the point of having another airfoil parameterization method? As it was pointed by Brenda in her paper (Brenda is a woman engineer, cool!), we want an intuitive, robust, smooth, and flexible parameterization method. Those are some of the reasons of why Brenda developed CST that is very simple to be coded and also it doesn’t take such a long time to understand the concept of CST itself. The greatest thing from CST is that CST can be used not only for an airfoil, but it can also be extended further into the general shape of aerodynamic bodies. For simplicity purpose, this simple article considers only CST for the two-dimensional shape of an airfoil.

CST build the airfoil by summing the individual contribution of its basis function that is elegantly built by Bernstein Polynomial. Roughly speaking, you also don’t want a bumpy airfoil, well, except if you want to add some shock bump on your airfoil. The good thing about Bernstein polynomial, and CST itself is that later you will see that the smoothness of its curve is beneficial for optimization purpose! Since the number of parameters can be tuned easily by altering the order of Bernstein polynomial, CST is suitable for either conceptual or preliminary design of airfoil.

Alright, let’s kick out the jams and move to the mathematical expression. The upper and lower surface coordinate of CST are easily defined as follows:

Where

Consider that you don’t know what is the meaning of *x, z, *and c, those creatures are absis, the ordinate location of the airfoil, and chord length or airfoil. Roughly speaking, two main important parts of CST are the so-called class (*C*) and shape function (*S*). Trailing edge thickness is another term that completes the CST equation but for a preliminary purpose, it might be not that important. The class function is the part that defines the type of aerodynamic body that you want to build; could be airfoil, nacelle, or even axisymmetric bodies. As you can see that class function takes *x *coordinate, *N1*, and *N2* as its input. N1 and N2 are two most joyful parameters of CST, you can play with these values and create various shapes with them. The general class function is defined as follows:

** **Gives N1 = 0.5 and N2 = 0.5, you get a round nose elliptic airfoil. Gives N1 = 0.75, N2 = 0.25, you get a low drag projectile shape. Now we consider N1 = 0.5, N2 = 1.0 and we will get a round nose and pointed aft end airfoil, exactly what we want for an airfoil.

I explained class function, and then you ask what is the shape function. After you define an airfoil with class function surely you don’t want a boring shape of an airfoil, right? You want to create another airfoil by yourself so now the definition of shape function comes in handy. The shape function itself defines the specific shape within the airfoil. Perfect, now you can make your own airfoil! Now I can give the expression of shape function:

*N *in shape function expression is the order of the Bernstein polynomial (note that N1 and N2 are different things!) and *A *is the weight/curvature coefficient. To alter the overall shape of airfoil then you’ve got to define the component shape function that is given as the following:

Oh my, another creature named *K*, God had chosen someone to named it binomial coefficient which is expressed as:

Now we can define the complete equation of CST for an airfoil:

Cool, the equation is now complete. Does it look difficult to you? No problem, you can download the MATLAB code at this article so you can understand and try it by yourself. Now let’s try the code! Let’s try by defining second-order CST, means that there are in total 6 weights/curvature coefficients to be determined. Let’s try the simple cases like Al = [-1 -1 -1] and Au = [1 1 1] . The MATLAB function CST_airfoil(wl,wu,dz,N) takes four inputs, where *wl,* *wu, dz, *and *N *are the vector of lower and upper surface weight, trailing edge thickness, and the number of airfoil coordinates, respectively. It is a very simple implementation of CST where you should give an* *input of *wl* like [-1 -1 -1] and with *wu *of [1 1 1]. You can set *dz *to zero and *N *to whatever value you like, I use 400 points for the figure shown below. (notice that I start with lower surface, you can modify it on your own). However, you can do a modification that is suitable for your needs, for example, is that if you want to define something like a different order of Bernstein polynomial for upper and lower surface. Note that the weight values for the lower surface are all negative to demonstrate how to build lower surface using the code, in reality, it is not always the case. For this case, we also assume that the trailing edge thickness dz is zero. Hit your MATLAB with CST_airfoil([-1 -1 -1], [1 1 1],0,400) and then you will see the following figure:

Alright, you did it! Now you can play around a little bit by altering the weight. Let’s try the following second-order CST curvature coefficients: [-0.1294 -0.0036 -0.0666] for lower surface and [0.206 0.2728 0.2292] for upper surface.

Clark-Y airfoil? Correct! I approximate the original airfoil of Clark-Y by minimizing the Root Mean Square Error (RMSE) between the CST-defined airfoil and real airfoil; you can use non-linear optimization routine to tune the weights of CST itself for approximation purpose. Now you see that even low order CST can approximate the real airfoil but of course not without flaw. In the end, it is only an approximation and overall it has a total maximum error of 0.0014. Increasing the order of Bernstein Polynomial will, of course, lead to a more accurate approximation of the real airfoil using CST.

You can also easily modify CST subroutine to combine it with other subroutines. For example, I combine CST with automatic unstructured mesh because I am doing something related to airfoil optimization as you can see it in the figure below:

Now feel free to make your own modified CST, combine it with optimization software, or whatever things that you want to do 🙂

That’s all about the CST method, have fun with it! For detail and more scientific information, you can read the references I give at the bottom line of this article 😀

Please download the CST_airfoil.m file here: https://www.mathworks.com/matlabcentral/fileexchange/42239-airfoil-generation-using-cst-parameterization-method

**(Update, 24-2-2017):** Please see my post about how to find the CST parameters for an existing airfoil here: How to fit your airfoil with CST parameterization?

**References:**

^{1}Kulfan, Brenda M. “A universal parametric geometry representation method—CST.” *AIAA Paper* 62 (2007).

^{2}Lane, Kevin A., and David D. Marshall. “A surface parameterization method for airfoil optimization and high Lift 2D geometries utilizing the CST methodology.” (2009): 1.

^{3}Ceze, Marco, Marcelo Hayashi, and Ernani Volpe. “A study of the CST parameterization characteristics.” *27th AIAA Applied Aerodynamics Conference*. 2009.

ehsan

said:hi. I need your help. I want model a submarine with this method (cst and csrt) but i don’t know how should I do this ? I need a matlab cod for three-dimentional by csrt method. If u can help me I very thank u my email is : ehsansaghaian@yahoo.com thanks for your attention

pramuditasatriapalar

said:Have you read the original papers for CST? The three dimensional code is just the extension of two dimensional CST. I don’t have the code for 3D but I think you can modify my code to suit your needs, but of course you have to read the paper first.

ehsan

said:Thanks for your time and attention.I read the paper and see your code.but my problem is how you can use Y/C and X/C for submarine and how can define the class function for submarine? why you use zeta an cos for calculate X?

Mostafa essuri

said:Hi

I need to know about the mesh generation script. I am working on low Reynold’s number optimization with GA’s.

It will be helpfull if I use mesh gen. function to speed up the process.

Mostafa

regards

pramuditasatriapalar

said:Hi mostafa,

I use MESH2D (http://jp.mathworks.com/matlabcentral/fileexchange/25555-mesh2d-automatic-mesh-generation) for mesh generation, I am also using it for robust optimization purpose with Euler SU2 as the solver.

MESH2D has a demonstration in the code of how to create a mesh for airfoil using the program. For my purpose, I specifically develop a code for automatic O-grid generation and also the code to write the mesh in .su2 format which is needed to pass the mesh to the SU2 solver. The validation is good, I compare it with the paper of Jameson that solve Euler equation around NACA 0012.

Regards,

Pram

N

said:Hello,

Can you tell me how did you create O-grid generation?

I need the code for that. I tried modifying the CST but i Had lots of errors. Can you please help me with the code?

Thanks.

imbran

said:I am doing my project in designing airfoil for propeller am little bit confused with estimating WL and wu. I request you to give me some examples for estimating those parameters clearly. the way of your explanation is marvelous that’s why I am seeking help from you

pramuditasatriapalar

said:Hello, sorry for the late reply.

Do you already have the coordinates for the airfoil? You can estimate the parameters by minimizing the geometrical error between the airfoil generated by CST and the airfoil of interest. This could be done via optimization. If you are familiar with matlab, you can use the unconstrained version of fmincon (I think it is fminunc or something) to do this. If you want some example in matlab I could send you some.

imbran93

said:Hi, thanks for your time and attention i have tried both fmincon and fminunic for optimization but i couldn’t get it.if you send me some example file relating optimization that would be more helpful for me

pramuditasatriapalar

said:Alright, please wait for a day or two. I will send you some examples of how to fit the geometry of existing airfoil with CST.

imbran93

said:awaiting for your reply……..

Charles J.

said:could you send me the example of how to fit an existing airfoil with CST? Thank you

pramuditasatriapalar

said:I am sorry for my very late reply.. hope you already figured about how to do this. But I can send you an example to your email if you still need it.

Laith

said:Hi…. This topic is very interesting. Well, I’m doing airfoil for rotating blade but I do really have no any idea with estimating WL and WU. Kindly and if its possible for you to give me some examples for estimating those parameters clearly, with my deep thanks…

pramuditasatriapalar

said:Guys, it looks like that many people need some help regarding how to fit an existing airfoil with CST parameters. Kindly send me an email and I will send you an example of how to fit an existing airfoil with CST parameters. I will write a simple post in my wordpress about how to do this soon enough (so busy lately..), but I can send you an email if you want some quick explanation and example. (my email is: pramsatriapalar@gmail.com)

pramuditasatriapalar

said:Kindly look at my new post! https://pramsatriapalar.wordpress.com/2017/02/24/how-to-fit-your-airfoil-with-cst-parameters/

Pingback: How to fit your airfoil with CST parameters? | Pramudita Satria Palar

pramuditasatriapalar

said:If you want a real demonstration of how to fit an existing airfoil with CST parameters, please kindly take a look at my new post:

https://pramsatriapalar.wordpress.com/2017/02/24/how-to-fit-your-airfoil-with-cst-parameters/