|
[Sponsors] |
Boundary Conditions for FORTRAN Lid Driven Cavity Error |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 23, 2023, 07:49 |
Boundary Conditions for FORTRAN Lid Driven Cavity Error
|
#1 |
New Member
Join Date: Jan 2023
Posts: 5
Rep Power: 3 |
I am studying Numerical Methods for incompressible flows. part of the tasks is to model the lid driven cavity problem in 2D using the SIMPLE method.
I have been provided with Fortran code that is working solved, however is for a channel flow problem. I was informed that by modifying the boundary conditions I can convert it from channel flow to cavity flow. (by manipulating which walls as velocity etc etc). I have created a SIMPLE Solver for the the Lid Driven Cavity Problem in MATLAB. It is known working and Validated against the Ghia et al.(1982) However when I modify the fortran code to what I believe to be the correct boundary conditions my results.dat file contains NaN for all values of U and V for all X and Y locations. I have attached a .zip file with the original Fortran Code, my attempted Lid Driven Cavity Conversion and parameter file. for U Momentum function Code:
! set boundary conditions for coefficients in the equations ! south aw(:,1)=0. ae(:,1)=0. as(:,1)=0. an(:,1)=0. ap(:,1)=1. su(:,1)=0. ! west aw(1,:)=0. ae(1,:)=0. as(1,:)=0. an(1,:)=0. ap(1,:)=1. su(1,:)=0. ! north aw(:,iNyUNodes)=0. ae(:,iNyUNodes)=0. as(:,iNyUNodes)=0. an(:,iNyUNodes)=0. ap(:,iNyUNodes)=1. su(:,iNyUNodes)=1. ! east aw(iNxUNodes,:)=0. ae(iNxUNodes,:)=0. as(iNxUNodes,:)=0. an(iNxUNodes,:)=0. ap(iNxUNodes,:)=1. su(iNxUNodes,:)=0. Code:
! south aw(:,1)=0. ae(:,1)=0. as(:,1)=0. an(:,1)=0. ap(:,1)=1. su(:,1)=0. ! west aw(1,:)=0. ae(1,:)=0. as(1,:)=0. an(1,:)=0. ap(1,:)=1. su(1,:)=0. ! north aw(:,iNyVNodes)=0. ae(:,iNyVNodes)=0. as(:,iNyVNodes)=0. an(:,iNyVNodes)=0. ap(:,iNyVNodes)=1. su(:,iNyVNodes)=0. ! east aw(iNxVNodes,:)=0. ae(iNxVNodes,:)=0. as(iNxVNodes,:)=0. an(iNxVNodes,:)=0. ap(iNxVNodes,:)=1. su(iNxVNodes,:)=0. and the output of my code is either incorrect values or NaN with different attempts of the boundary conditions Apologies for this being long, I wanted to be as thorough as possible as I cannot understand what is incorrect. (it is known that the Fortran solver is validated as accurate, and my MATLAB solver) however these results do not matchup after my boundary edits. Thanks in advance |
|
Tags |
fortran 90, incompressible flow, lid driven cavity |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
long error when using make-install SU2_AD. | tomp1993 | SU2 Installation | 3 | March 17, 2018 07:25 |
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch | gschaider | OpenFOAM Installation | 225 | August 25, 2015 20:43 |
OpenFOAM without MPI | kokizzu | OpenFOAM Installation | 4 | May 26, 2014 10:17 |
ParaView for OF-1.6-ext | Chrisi1984 | OpenFOAM Installation | 0 | December 31, 2010 07:42 |
How to get the max value of the whole field | waynezw0618 | OpenFOAM Running, Solving & CFD | 4 | June 17, 2008 06:07 |