CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Wiki > Sample code for solving Lid-Driven cavity test (Re=1000) - For...

Sample code for solving Lid-Driven cavity test (Re=1000) - Fortran 90

From CFD-Wiki

(Difference between revisions)
Jump to: navigation, search
 
(13 intermediate revisions not shown)
Line 2: Line 2:
''It's just a scrap. Later I'll correct it, although it's a complete working code -- Michail''
''It's just a scrap. Later I'll correct it, although it's a complete working code -- Michail''
 +
 +
'' I fixed some bugs. Now on 80x80 mesh it solves Re=1000 lid-driven cavity using HLPA scheme with error of 2% -- Michail - 2016.05.19''
Sample program for solving Lid-Driven Cavity Test using SIMPLE-algorithm
Sample program for solving Lid-Driven Cavity Test using SIMPLE-algorithm
-
'''Copyright (C) 2010  Michail Kiričkov ,Lithuania, Marijampole'''
+
'''Copyright (C) 2010  Michail Kiričkov , Lithuania, Marijampole'''
 +
 
 +
'''Copyright (C) 2016  Michail Kiričkov , Lithuania, Kaunas University for Technology'''
This program is free software; you can redistribute it and/or
This program is free software; you can redistribute it and/or
Line 24: Line 28:
'''Short description'''
'''Short description'''
-
In this program general transport equation for scalar transport is solved.  
+
In this program SIMPLE algorithm on colocated, regular and orthogonal grid is implemented.  
 +
 
 +
Rhie-Chow interpolation is used.
 +
 
Because it was primarily developing program for learning, there was implemented an output for all variables in the txt format as well as for TECPLOT format.
Because it was primarily developing program for learning, there was implemented an output for all variables in the txt format as well as for TECPLOT format.
Structured orthogonal uniform grid is used (now). All variables are saved in array '''F(1:nx,1:ny,10)''' which mean that 2D array for 10 variables.  
Structured orthogonal uniform grid is used (now). All variables are saved in array '''F(1:nx,1:ny,10)''' which mean that 2D array for 10 variables.  
-
Variables '''F(:,:,1)''' and '''F(:,:,2)''' represented U and V velocity components, and  '''F(:,:,4)'''represented pressure.
+
Variables '''F(:,:,1)''' and '''F(:,:,2)''' represented U and V velocity components, and  '''F(:,:,4)'''represented pressure.
 +
 
 +
'''F(:,:,3)''' represents pressure correction.
Arrays '''Xc''' and '''Yc''' represents the coordinates of the CV centres, and '''X''' and '''Y''' - coordinates of grids nodes
Arrays '''Xc''' and '''Yc''' represents the coordinates of the CV centres, and '''X''' and '''Y''' - coordinates of grids nodes
Line 35: Line 44:
*[[Main_Cavity.f90              - Main modul]]
*[[Main_Cavity.f90              - Main modul]]
-
*[[Common_incld.f90              - include module]]
+
*[[Common_incld.f90              - include module]] - the same as icomm_1.f90
*[[Init_all.f90                  - Initiation of arrays]]
*[[Init_all.f90                  - Initiation of arrays]]
*[[Grid_rectangular.f90          - Calculation of grid]]
*[[Grid_rectangular.f90          - Calculation of grid]]
Line 48: Line 57:
-----------------------------------------------------------------
-----------------------------------------------------------------
 +
[[Image:Grid_annumeration_for_cavity.jpg]]
 +
 +
[[Image:Faces_annumeration_01.jpg]]
 +
[[Image:Faces_annumeration_02.jpg]]
 +
[[Image:Faces_annumeration_03.jpg]]
 +
 +
 +
solution on 20x20,40x40,80x80 mesh, using HLPA scheme for convective terms
 +
 +
on 80x80 mesh it solve with 2% error
 +
 +
V - velocity distribution along X=0.5
 +
U - velocity distribution along Y=0.5
-
[[Image:CavityRe1000.jpg]]
+
[[File:LDC_HLPA_all_proba.jpg]]

Latest revision as of 10:04, 20 May 2016

Dear friends

It's just a scrap. Later I'll correct it, although it's a complete working code -- Michail

I fixed some bugs. Now on 80x80 mesh it solves Re=1000 lid-driven cavity using HLPA scheme with error of 2% -- Michail - 2016.05.19

Sample program for solving Lid-Driven Cavity Test using SIMPLE-algorithm Copyright (C) 2010 Michail Kiričkov , Lithuania, Marijampole

Copyright (C) 2016 Michail Kiričkov , Lithuania, Kaunas University for Technology

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


Short description

In this program SIMPLE algorithm on colocated, regular and orthogonal grid is implemented.

Rhie-Chow interpolation is used.

Because it was primarily developing program for learning, there was implemented an output for all variables in the txt format as well as for TECPLOT format. Structured orthogonal uniform grid is used (now). All variables are saved in array F(1:nx,1:ny,10) which mean that 2D array for 10 variables.

Variables F(:,:,1) and F(:,:,2) represented U and V velocity components, and F(:,:,4)represented pressure.

F(:,:,3) represents pressure correction.

Arrays Xc and Yc represents the coordinates of the CV centres, and X and Y - coordinates of grids nodes



Grid annumeration for cavity.jpg

Faces annumeration 01.jpg Faces annumeration 02.jpg Faces annumeration 03.jpg


solution on 20x20,40x40,80x80 mesh, using HLPA scheme for convective terms

on 80x80 mesh it solve with 2% error

V - velocity distribution along X=0.5 U - velocity distribution along Y=0.5


LDC HLPA all proba.jpg

My wiki