Aviumtechnologies APM Docs
  • Introduction to APM
  • Quick start
    • Set up your licence key
  • Release notes
  • User guide
    • The configuration file
      • Calculating pressure
      • Calculating skin friction
      • Creating control surfaces
      • Creating actuator disks
    • The mesh file
      • Creating meshes
        • OpenVSP
        • SUMO
    • Preprocessor
    • Solver
      • Steady simulations
      • Unsteady simulations
      • Symmetry
      • Wake
        • Interaction with the body
        • Viscous vortex particle wake
    • Output files
  • Examples
  • Sphere
  • Ellipsoid
  • NACA4412 wing
  • NACA0015 wing
  • Caradonna-Tung rotor in hover
  • NREL Phase IV wind turbine
  • AGARD-AR-303 E6
  • Wing-tail configuration
  • Fixed-wing UAV
  • Aerosonde UAV
Powered by GitBook
On this page

Was this helpful?

  1. User guide
  2. Solver

Unsteady simulations

PreviousSteady simulationsNextSymmetry

Last updated 2 years ago

Was this helpful?

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);

Custom motion can be specified, if required, during unsteady simulations. If a .motion file is created in the current working directory the APM solver will ignore the dtand N_timestepsoptions specified in the .conf file and will use the time step and number of time steps specified in the .motion file. The unsteady motion file contains 10 variable per row - ttt,uuu,vvv,www,ppp,qqq,rrr,ϕ\phiϕ,θ\thetaθ, and ψ\psiψ. The variables represent the velocity components, rotational rates, and kinematic angles at each time step. An example motion is a sinusoidal motion with a variation of the angle of attack given by:

α=Asin(ωt),ω=2πf,\alpha=Asin(\omega t)\text{,}\\\omega=2\pi f\text{,}α=Asin(ωt),ω=2πf,

where fff is the frequency of the motion and AAA is the amplitude of the angle of attack. The uuuandwww variables can be determined from the equation for α\alphaα:

tan(α)=uw∣Vref∣=u2+w2v=p=q=r=ϕ=θ=ψ=0 tan(\alpha)=\frac{u}{w}\\|V_{ref}|=\sqrt{u^2+w^2}\\ v=p=q=r=\phi=\theta=\psi=0tan(α)=wu​∣Vref​∣=u2+w2​v=p=q=r=ϕ=θ=ψ=0
Unsteady simulation of a NACA4412 wing
Unsteady simulation of a NACA4412 wing with custom motion