Unsteady simulations

For unsteady simulations the APM Solver assumes that the wake is free, i.e. the wake is allowed to deform and interact with itself and the body. The following options in the .conf file are changed:

  • dt - the time step size in seconds

  • N_timesteps - the number of timesteps

  • output_frequency - the results output frequency

Two of the three options are identical to the ones for steady simulations, however, their values differ. The time step, dt, should be selected such as to allow proper development of the wake. As an initial estimate dt should be selected as the time it takes the flow to travel one chord length. If the airspeed is norm_V_ref=10 m/s and the c_ref=1 m, dt should be approximately 0.1s. The number of time steps N_timesteps should be sufficiently high to allow the aerodynamic loads to stabilise. The output_frequency option instructs APM how often to output results.

If the output_frequency option is equal to 10, the APM Solver will output results every 10 timesteps. The values for airspeed and chord are arbitrary and are used for illustrative purposes.

Custom motion

The image above shows an unsteady simulation of a NACA4412 wing with custom .motion file. The structure of an example .motion file is shown below:

0.000000 1.000000 0.000000 0.000000 1.370778 0.000000 0.000000 0.000000 0.000000 0.000000
0.010000 1.000000 0.000000 0.000000 1.353902 0.000000 0.000000 0.013651 0.000000 0.000000
0.020000 1.000000 0.000000 0.000000 1.303688 0.000000 0.000000 0.026967 0.000000 0.000000
0.030000 1.000000 0.000000 0.000000 1.221372 0.000000 0.000000 0.039618 0.000000 0.000000
0.040000 1.000000 0.000000 0.000000 1.108983 0.000000 0.000000 0.051294 0.000000 0.000000
...

Below is an example MATLAB file which can be used to generate a .motion file.

clear all;
close all;
clc;

V_ref=1; %freestream velocity (m/s)
c_ref=1; %reference chord
t_max=c_ref*100/V_ref; %maximum simulation time
N_cycles=3; %number of oscillation cycles
N_timesteps=50; %number of timesteps
dt=t_max/N_timesteps; %timestep size (s)
t=0:dt:t_max;
V_ref=1; % reference velocity
A=deg2rad(5);  %oscillation amplitude (deg)
f=N_cycles/t_max; %oscillation frequency (Hz)
omega=2*pi*f;

phi=A*sin(omega*t);
theta=A*sin(omega*t);
psi=A*sin(omega*t);
p=A*cos(omega*t)*omega;
q=A*cos(omega*t)*omega;
r=A*cos(omega*t)*omega;


motion_file=fopen('rolling.motion','w');

for  n=1:length(t)
    
    t_out=t(n);
    u_out=V_ref;
    v_out=0;
    w_out=0;
    p_out=p(n);
    q_out=0;
    r_out=0;
    phi_out=phi(n);
    theta_out=0;
    psi_out=0;
   
    fprintf(motion_file,'%0.6f %0.6f %0.6f %0.6f %0.6f %0.6f %0.6f %0.6f %0.6f %0.6f\n',t_out,u_out,v_out,w_out,p_out,q_out,r_out,phi_out,theta_out,psi_out);
    
end

fclose(motion_file);

motion_file=fopen('pitching.motion','w');

for  n=1:length(t)
    
    u=V_ref*1/sqrt(1+tan(theta(n))^2);
    w=u*tan(theta(n));
    
    t_out=t(n);
    u_out=u;
    v_out=0;
    w_out=w;
    p_out=0;
    q_out=q(n);
    r_out=0;
    phi_out=0;
    theta_out=theta(n);
    psi_out=0;
   
    fprintf(motion_file,'%0.6f %0.6f %0.6f %0.6f %0.6f %0.6f %0.6f %0.6f %0.6f %0.6f\n',t_out,u_out,v_out,w_out,p_out,q_out,r_out,phi_out,theta_out,psi_out);
    
end

fclose(motion_file);

motion_file=fopen('yawing.motion','w');

for  n=1:length(t)
    
    v=V_ref*sin(-psi(n));
    w=0;
    u=sqrt(V_ref^2-v^2-w^2);
    
    t_out=t(n);
    u_out=u;
    v_out=v;
    w_out=w;
    p_out=0;
    q_out=0;
    r_out=r(n);
    phi_out=0;
    theta_out=0;
    psi_out=psi(n);
   
    fprintf(motion_file,'%0.6f %0.6f %0.6f %0.6f %0.6f %0.6f %0.6f %0.6f %0.6f %0.6f\n',t_out,u_out,v_out,w_out,p_out,q_out,r_out,phi_out,theta_out,psi_out);
    
end

fclose(motion_file);

Last updated