CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   Time step help in Explicit method (http://www.cfd-online.com/Forums/main/122166-time-step-help-explicit-method.html)

archeoptyrx August 13, 2013 13:06

Time step help in Explicit method
 
Hello everyone ,

I have wrote a code for solving compressible navier stokes code over a flat plate (same as given in the Anderson CFD Book) . when i tried simulating it with free stream conditions at higher altitude for example

Plate length of 1e-5 encounters slip regime above 10km altitude , which means that slip boundary conditions should be incorporated to get proper results , and the code blows up for free stream conditions above 20km (because transition regime comes into play )

Am i correct guys ? Navier stokes equation works only for continuum regime right ?

So i am using MACCORMACK Method with the time step given in book . Its because of the time step , which brings up complex numbers and its causes the program to stop .

What should i do now ?

Any suggestion will be of great help

Thanks in advance

flotus1 August 13, 2013 13:28

While the NS equations are only valid in the continuum regime, a NS solver should still be able to produce a (wrong) solution in the rarefied regime.
If your NS code diverges for higher Knudsen numbers, there must be something wrong with the code.

archeoptyrx August 13, 2013 13:31

Alex,

I checked the code and i find that i implemented the time step (stability criteria) wrong . This produces the complex number first which makes the solver to blow up for higher Knudsen numbers

archeoptyrx August 13, 2013 13:35

Take a look at my time step , I implemented it wrong .

Code:

function delt=Tstep(u,v,T,rho,mu)
% K        -Fudge factor 0.5<K<0.8
% delx      - xinterval
% dely      - y interval
% u        - horizontal velocity at (i,j)
% v        - Vertical velocity at (i,j)
% a        - Speed of sound at (i,j)
% mu        - Dynamic viscosity at (i,j)
% Pr        - Prandtl Number
% rho      - Density at (i,j)
% gamma    - iscentropic constant
global K Pr gamma imax jmax delx dely;
% global u v T rho mu;

a=Sound(T);
vda=zeros(imax,jmax);
deltcfl=zeros(imax,jmax);
for i=1:imax
    for j=1:jmax
%                mu(i,j)=Dynvis(T(i,j),2);
        vda(i,j)=((4*mu(i,j)*gamma*mu(i,j))/(3*rho(i,j)*Pr));
    end
end
vdas=max(max(vda(:)));
for i=1:imax
    for j=1:jmax
        A=abs(u(i,j))/delx;
        B=abs(v(i,j))/dely;
        C=a(i,j)*sqrt((1/(delx^2))+(1/(dely^2)));
        D=2*vdas*((1/(delx^2))+(1/(dely^2)));
        deltcfl(i,j)=(A+B+C+D)^(-1);
    end
end

delt=real(min(min(K*deltcfl(:))));
end



All times are GMT -4. The time now is 15:02.