Showing posts with label Dynamics. Show all posts
Showing posts with label Dynamics. Show all posts

Thursday, 7 September 2017

SolidWorks Animation: Transient NREL Phase-VI Wind Turbine CFD Simulation [Validated]

     10 KW wind turbine CFD simulation using Flow Simulation Premium. Design points: 10 m/s wind speed, rotational velocity 7.5 rad/s.

     The rendered volume shows vorticity (curl of the velocity field). It is colored by dynamic pressure. Low pressure in the center of the helix shows very small wind speed.



     Power from the CFD analysis was 9,854.96 W while the experimental power is 10,000 W, a difference of only 1.45 %, that too by using only 693,141 cells in the mesh.

     Do you want me to make a tutorial about the simulation setup with SolidWorks Flow Simulation Premium?

Thursday, 16 June 2016

Computational Fluid Dynamics: 1 Core VS 2 Cores VS 3 Cores VS 4 Cores. (SolidWorks Flow Simulation Premium)

Problem:
Lift and Drag calculation for a rectangular wing (0.5 m span x 0.15 m chord x uniform cross section of NACA 9410), at horizontal velocity of 10 km/h.

A very simple CFD problem (with 177250 cells) solved on a 4 core Haswell-DT, varying the number of CPU cores used each time; CPU times are as below:

Cores used            CPU time taken for solution (1 travel convergence)
1/4 core                 782 seconds (2.31x slower)
2/4 cores               468 seconds (1.38x slower)
3/4 cores               380 seconds (1.12x slower)
4/4 cores               339 seconds (1x)

Computational Fluid Dynamics: Finite Difference Approximations VS Analytical Differentiation (MATLAB)

Description of the Program

The program takes user input for the function of the variable ‘x’ e.g. x2, sin(x), cos(x)/x2 etc., the point on which the derivative is evaluated and initial and final grid sizes.

The program then calculates its first derivative analytically.

It then calculates finite difference approximations of the first derivative of order h, with point A unknown and the point A known, using various step sizes, with maximum and minimum step size enter by the user.

 It then calculates and plots the error between the exact value and the approximations of the first derivative.

Code along with Guidelines


clc; %clears the command window

 

%data input and analytical differentiation

 

syms x

fx=input('Enter the function of ''x'' to be differentiated '); %input a function like sin(x) or x.^4 + x.^3

clc; %clears the command window

fxp=(diff (fx,x)); %calculate the derivative analytically

x=input('Enter the point at which the derivative is to be evaluated '); %input the value at which the derivative to be evaluated

clc; %clears the command window

y=inline(fxp,'x'); %convert a statement in to a function so it can be evaluated at some point

z=y(x); %derivative evaluated at the point

 

 

dxmin=input('Enter the smallest value of increment ');

clc;

dxmax=input('Enter the largest value of increment ');

clc;

%finite difference approximation

for dx=dxmin:0.001:dxmax; %loop for different values of grid spacing, dx=h1

    a=1.5;

    h1=a*dx; %h2 in the problem sheet

    h2=(2*a*dx); %h3 in the problem sheet

   

    fc=cos(5+h2)/(5+h2).^2; %value of the function at point c

    fb=cos(5+h1)/(5+h1).^2; %of the function at point b

    fa=cos(5-dx)/(5-dx).^2; %of the function at point a

    fi=cos(x)/(x).^2; %of the function at point A

    fxpu=(fc+fb-(2*fa))/((2*dx)+h1+h2); %formulation with A unknown

    fxpa=(fc+fb+(2*fa)-(4*fi))/((-2*dx)+h1+h2); %formulation with A known

    hold on

    plot ((z-fxpa)/z,dx,'.k') %error plot for approximation with A known

    plot ((z-fxpu)/z,dx,'.r') %error plot for approximation with A unknown

end

%text editing

title('Plot Between Error VS Grid Spacing') %title of the graph

xlabel('Error from the Exact Value'); %x-axis label

ylabel('Step Size/Grid Spacing') %y-axis label

text(0.6, 0.9,'Red: Error plot for approximation with A unknown') %identification

text(0.6, 0.85,'Black: Error plot for approximation with A known') %identification

Calculation


Sample Problem

Command Window after running the code

At Step One


Enter the function of 'x' to be differentiated cos(x)/x.^2

At Step Two


Enter the point at which the derivative is to be evaluated 5

At Step Three


Enter the smallest value of increment 0.001

At Step Four


Enter the largest value of increment 1
Result

 

Observations and Recommendations

It was observed that the error in the finite difference approximation when the value of the function at point A is unknown is less as compared to the case where value of the function at point A is known.
In physical/real-world problems, the exact derivatives of the functions are not known, therefore the error values between the exact and the finite difference approximation cannot be calculated. As it is also observed that the error between finite difference approximation and the exact value of the derivative decreases as the step size decreases, it is advisable to use a step size of ~1/1000 to make a compromise between CPU/RAM usage, time taken to solve the problem and error.