Navier stokes and maxwell slip boundary
Hello ppl ,
I wrote a MATLAB code for the compressible navier stokes equation as per the Anderson CFD book . now I am trying to implement the Maxwell slip and temperature jump boundary conditions . its in first order . Could anyone help me in implementing this to the code ? I am no familiar with this Neumann type of boundary conditions . I have a grid of 70*70 . with flat plate at y=0 and ranging from 0<=x<=L Previously I just used , For i=2:imax U(i,1)=0; T(i,1)=300; End How should I modify it ??? Looking for someone to help me understand in implementinv this derivative boundary conditions. Thanks 
You have several options for the implementation of a first order Maxwell boundary condition.
The easiest (for finite volumes) would be the way Fluent does it. They obtain the wallnormal gradients for velocity and temperature from finite differences between the values at the wall and a the first cell center. Then they apply the value calculated from the Maxwell boundary condition to the boundary. So you need a temporal storage to store the boundary value from the last iteration to use it in the finite differences for the next iteration. Keep in mind that in doing so, the spatial accuracy of the whole computation is reduced to first order. To prevent this, you could for example evaluate the wallnormal gradient at the wall with a higher order finite difference scheme that uses additional points further away from the wall. Some kind of underrelaxation might be necessary to keep this kind of BC stable, especially with higher order finite difference schemes for the gradients. 
2 Attachment(s)
OK . my Matlab code is explicit mccormack method . now . I set up the free stream conditions .
Next for the first iteration , I m struck in initializing the domain as in t pic below . At wall , What should I do for velocity and temperature? For t first iteration . should I include , Us=0 Two=300; And for t successive iteration , I attached a pic . please take a look and help me out if you can . Thanks Quote:

From what I recall, the nonisothermal slip boundary conditions for flat walls read:
where superscript t denotes the walltangential direction and denotes the derivative in wallnormal direction The tangential velocity of the wall appears to be 0 in your setup while the temperature of the wall seems to be 300K. Given the macroscopic gradients, this provides you with explicit expressions for the boundary values to be set in the computation. Suitable initial conditions for slip velocity and temperature could be the macroscopic values of these quantities at the wall (0 m/s and 300K). Maybe this document provides some guidance for the implementation of the code: http://fluid.ippt.gov.pl/seminar/text/steffen110407.pdf 
Thanks a lot Mr.Alex .
I will try running the code now . Let me post the results in some couple of hours 
Quote:
I tried running in the way u said . But after 40000 iterations , it didn end . When i plottted the contour of Pressure , it showed some very weird plot. what could be the problem ? My model is same as Anderson Flat plate of same length . so LHORI = 1e5; number density =8..266e24; should produce a knudsen number of KN=0.0156 which lies in the slip regime . And Maxwell first order boundary condition should work in this regime . But for me it didnt even produce any reasonable results . Any suggestions ?? 
1 Attachment(s)
Mr.Alex ,
If possible can you take a look at these files:(:(:(. 
I assume your code produces reasonable results without the Maxwell boundary condition?
I will have a closer look at the code tomorrow. For now, you could try to apply some underrelaxation to the boundary values. In my implementation in a Lattice Boltzmann code, this step was crucial for the stability of the Maxwell BC. No results could be obtained without underrelaxation. Do I need to know what LHORI means? 
Yes . My code produces good results with noslip BC . I even compared the plots to Anderson book . When it comes to slip , it just give me wrong values or some weird plots .

Forgot to mention: In addition (or if your code is stable instead of) of applying underrelaxation, you can also limit the boundary value to the value at the nearest fluid node.
My preferred sequence for this is first apply the limitation, then the underrelaxation. Hope your code runs better now. If you still want me to comment on the implementation of the Maxwell boundary, please post the code in text form (no screenshots). That will make it much easier for me. 
2 Attachment(s)
Quote:
I am sorry for posting images. I tried uploading the .m files and it didnt allow me . Have a look at this plot which is obtained after 200 iterations (i used second order accurate for the gradient terms and u=0,Tw=300 as initial wall conditions) . Should i run the simulation for some 1000 iterations and look for the results ..? The Knudsen number for this simulation is Kn=0.07 . I have the results from openfoam DSMC solver for the same to validate my code results . Also have a look at the BC. Help me out if i am wrong . 
I imagined something like this, but at least we have text now
What is Ac in your expression for the slip velocity? Code:
% surface boundary j=1 with Maxwell Slip Boundary 1st order 
Ac =0.8 . Like i am taking only 80% of the calculated values . If its not needed i ll remove it . I modified it . Let me try and post the results ..
Thanks archep 
In this case, remove Ac from the formula.

2 Attachment(s)
Mr.Alex ,
I have deleted the Ac in the program. Now it showed me mass flow discontinuity after 5 iterations . Kindly check for the convergence criteria and Mass conservation file attached .May be bcz of that the meanfree path of 0.07 , to the value that produces slip . should I have to change something in the files attached ? 
Please post your functions with [CODE] tags.
What is this supposed to do? As soon as the absolute difference for the density is larger than 1e8 in any element in any time step, the solution is considered diverged? I disagree on such a criterion for divergence. Code:
Convergence=1; Again, I would not subscribe to such a criterion for "discontinuity". This function simply checks if the mass flow rate at the outlet is higher than at the inlet. If this is the case, you say it is a mass discontinuity. During the iterative solution process, such conditions can not be avoided. Code:
function Verf=Mdot(rho,u) Did you really stop iterating when the warning messages from these functions showed up? 
Quote:
Actually this code of convergence is the one provided in book . Now the thing is it actually worked for no slip conditions producing exactly same results as given in the book . The book says "The solution is considered as converged when the density at each grid point changes no more than 10^8 between time steps ." So in each time step , the main program sets time step , does maccormick calculations , then calls this convergence function , and if the diff btween previous time step is less than the prescribed one , it will stop , else it will exchange the values of new rho to oldrho and goes for second time step . Code:

Ok, now I get the point for the convergence criterion with the mass flow discontinuity. I actually misinterpreted the code.
But why do you break the solution process as soon as the mass imbalance is larger than 1% between inlet and outlet? 
No i am not breaking . Till complete convergence , the program runs , after the convergence the mass imbalance is checked to say whether the mass is conserved at inlet n exit . So now I tried with what you said . I ended up with errors for fixing the mean free path . I tried to use the formula for mu + limiter > errors it stopped at 45 iterations
What should i do further ? But the way i implemented the slip and jump conditions are correct right ?? 
I am running out of ideas.
The way the velocity and temperature boundary conditions are implemented should be correct, provided your adjustments for the temperature are correct. What happens if you set the slip velocity and temperature to constant values (but not the actual values of the wall) 
All times are GMT 4. The time now is 16:03. 