Fortran code

Hi Dear All,
I just hardly finished the code for square cylinder and the results are very good. I using Fortran for making codes i easily create a part of code in Fortran that if i need to visualize the vorticity contours or steam lines i can easily see the drawing results using Tecplot. Now i want to make a code for circular cylinder, but i have not so much idea about how to set a part oc code for circular geometry in Fortran that then i can visualize my results using Tecplot. Can any body know how to set the geometric part for circular cylinders using Fortran to drawing graphs in Tecplot.
Thanks and Best Regards
Yuan Chao Mei

Hi dear yuanchaomei
I think you can handle that by using Digitizer

Dear yuanchaomei,

i am working on square cylinder.
I wrote a code in FORTRAN and i have some difficulties in the visualization part!!
It would be really high appreciate if share with me any code.

Thanks in advance.

Dear Omid,
I need to modify my code more for some specific problems. If you can tell me where you face the problem so i can send you that part of the code and once i sure that my code is adequate and relaible then it’s my pleausre to share with you and any friend.

Dear Yuamchaomei ,

As I mentioned in previous comment, I have some difficulties in the visualization part of code. With more detail, my problem is that how I should write a part of my code which is related to drawing of the velocity contours in different time steps in the Techplot Software. I would like to share our codes and I am interested in imparting your experiences in this field. It would be high appreciated if you could send your email address for me to send my code.

Hi Dear Omid,
Sure my email id is
Best Regards

Dear all
I am a new user of LBM with Fortran 90. I have the code which examins the flow past a cylinder placed in a channel using D2Q9. Now I want to evaluate the drag force exerted on the fluid by the cylinder using momentum exchange method. I will be thankful if some one send me this Subroutine or new complete code.

Hi Dear ImtiazRaja,
Dear Imtiaz you need to be very careful using the momentum exchange method i observed that the lift and drag forces will not be accurate using LBM. Because about the interpolation around the object boundary.
If your code is for square cylinder then it’s not so difficult because we know the four corners and we can use the momentum exchange method easily. But in case of circular cylinder much more attention is required for lift and drag coefficients calculations.
Good Luck

Dear yuanchaomei

Thank you very much for your kind advice which will be helpful for me in my calculations. But still I am far from the code which I needed. Would you pls help me in writing code for circular/rectangular cylinder?

Thanks in advance

Hi Dear ImtiazRaja,
It’s my pleasure to share my code with you, but dear the most important thing is that you need to level up your programing skills and try first to write code by yourself. It will help you in future if you face some problems that you send to me step by step your code and i will check it for you and will tell you that what you need to change and how you need to develop a code.
Best Regards

Dear yuanchaomei

Hi and belated happy new year. I am using the code which examins the flow past a cylinder placed in a channel using D2Q9.I took this code from this website.To evaluate the drag force exerted on the fluid by the cylinder using momentum exchange method I added a subroutine in the code which is has still some errors. I want to send it on your email. I saw your email here which is I will be thankful if you allow me to send my code and then for your kind advise.


Dear imtiazaraja,

based on my experience, i suggest that do not send your code to yuanchaomei !!

Good luck.

Dear Mohammad816,
I hope you will be ok. I study that code it already available on the net. He not write a code by ourself.
So please don’t mind and help him.
Best Regards
Yuan Chao Mei

Dear yuanchaomei !!
I hope you will be ok too!!!

here is your last mail!
“Hi Dear Mohammad,
Dear friend i will try to set your code according to your requirements very soon and send it back to you.
Best Regards

i am speaking about morality, not drag!!! and not LBM!!!
i wrote in the mail that the code was written by Mr. Malaspinas.
so good luck !

Dear All,

I feel desperate with Momentum Exchange method(MEM), or I didn’t understand well with the two related paper, please kindly give your hand!!

I made code to calculate Poiseuille flow, the velocity contour looks pretty good. then I tried to calculate the Drag force and lift force on the top wall with MEM, as following fortran codes. But the result is totally wrong… Dragforce is around -1, and Liftforce is around -77., I think reasonally the drag force should be large value and liftforce should be very small…–!

Your suggestion would be highly appreciated…

Parameters: Re=20, Umax=0.05, nx=200,ny=40…
BCs: Top and bottom is simple bounce back; inlet: parabolic velocity profile; outlet: 0-gradient of velocity and fixed density to 1.
Calculation seququnce: Collision step–>>Boundary Condition treatment–>> Force evaluation–>>Stream step–>>Collision…
subroutine evaluatingForce

  do i=1,nx
        fdrag = fdrag + m(7)*(f(7,i,ny+1)+f(5,i-1,ny)) + m(8)*(f(8,i,ny+1)+f(6,i+1,ny))
        flift     = flift    +  n(7)*(f(7,i,ny+1)+f(5,i-1,ny))  + n(8)*(f(8,i,ny+1)+f(6,i+1,ny)) + n(4)*(f(4,i,ny+1)+f(2,i,ny))


Hey Folks, if can somebody share with me the 2d channel flow past cylinder code in fortran, I’m new in this method, and I have an exercice to do.
please someone help me