
[Sponsors] 
December 29, 2022, 11:32 
Flow in porous media: a basic question (2)

#1 
New Member
tara behmanesh
Join Date: Jul 2022
Posts: 13
Rep Power: 4 
Hello,
I have some questions that are really simple and may seem ridiculous but i am struggling with them. Second question: at the inlet of a cylindrical porous media the vlocity has parabolic profile.(which i think is 1 dimensional) More information: (it is given by : V=V0*(1(r/R)^2) Which V0 is a constant, R is the radius of cylinder, r is radial distance from the center) Based on this and using darcy law the pressure drop at te first row should be equal to : PinP(at the next row )=V*dy*mu/k (Please note that by Pin i mean the values of pressure at the first row of the nodes) (Where V is velocity at inlet ,dy is vertical or/axial distance between nodes, mu is dynamic viscosity, k is permeability) which i have no problem with. Parabolic profile of velocity causes pressure variations in radial direction so we kinda have pressure drop along radial direction which shows that we should have a non zero velocity component along radial direction, u, From center towards the wall. But it seems (based on my understandings) that at inlet we are given 1 dimensional flow So if it is not true to assume u=0 in porous media then how should i define it at inlet? Should i use the Pin values (which i calculated using darcy law) to calculate u ? Like this: u1_2 (radial component of velocity between node 1 and node 2, in the first row)=(Pin(1)Pin(2))*k/(mu*dx) Where k is permeability, mu is dynamic viscosity and dx is radial or/ horizontal distance between nodes. And Pin(1)Pin(2)=V0*dy*mu/k*( ( 1 ( r1/R )^2 )  ( 1 ( r2/R )^2 )= V0*dy*mu/k*( (r2)^2  (r1)^2 )/R^2 mu is fluid property and if we assume that our porous medium has homogeneous distribution of pores and is isotropic then k is a constant so we can write: u1_2=V0*dy*dx*((r2)^2(r1)^2)/R^2 Is it true or what we should do to calculate u at inlet boundary ? (If there is any u it's value at walls is set to zero because of no penetration boundary condition and at outle the pressure is set to zero so there is no change in pressure along radial direction. ) Sorry if i am too lost and my questions doesn't make sense Thanks a lot 

December 29, 2022, 12:00 

#2 
Senior Member
andy
Join Date: May 2009
Posts: 276
Rep Power: 18 
Is this homework?


December 29, 2022, 13:29 

#3 
New Member
tara behmanesh
Join Date: Jul 2022
Posts: 13
Rep Power: 4 
It is a try to resimulate a simulation article (in tissue engineering). The problem is consist of a time dependent (due to change in porosity of porous media with growth of mass ) flow in a porous media (a scaffold) described by Brinkman equation, coupled with reaction diffusion equation and a growth equation.
My major isn't mechanical engineering so i did know almost nothing in CFD and previously i didn't do any mathematical modeling and the most similar thing i did was solving a problem consisting of 2 ODEs using MATLAB ode45 😅 ( a bout 4 years ago) which i found it really cool at that time. Anyway currently i have problems with pressurevelocity coupling,(i was first introduced to pressurevelocity coupling in YouTube and get to know what's staggered grid and ACM and watched and solved a flow in cavity problem using ACM. To be honest befor that i did not know what to do with pressure ) but the problem is that in solving the "cavity flow" for example i knew what is the value of velocity first component at the all 4 boundary and so on. But here i have velocity profile at inlet and pressure at outlet so i tried to think what to do and came up with using of darcy formula for finding pressure at inlet and... Long story short i am just trying to find answers for simple questions that i face (by using as little as i know) and then ask am in a right way or not?😊 By the way i can't understand how simple or even funny my questions are cause i know almost nothing, so for me these are serious issues which I think about. And if anyone knows a good book (simple language and inclusion of basic concepts is really important) in CFD please introduce to me,it's really better if it does have some hands on. Thanks Last edited by tara behmanesh; December 29, 2022 at 15:14. 

December 29, 2022, 13:43 

#4 
Senior Member
andy
Join Date: May 2009
Posts: 276
Rep Power: 18 
Are you writing the CFD code from scratch, using an existing one and trying to work out how to specify your problem, adapting an existing CFD code for your problem, or something else.


December 29, 2022, 15:18 

#5 
New Member
tara behmanesh
Join Date: Jul 2022
Posts: 13
Rep Power: 4 
Yes i am using a code which was for flow in cavity and trying to modify it for my problem.


December 29, 2022, 16:37 

#6 
Senior Member
andy
Join Date: May 2009
Posts: 276
Rep Power: 18 

December 29, 2022, 16:57 

#7 
New Member
tara behmanesh
Join Date: Jul 2022
Posts: 13
Rep Power: 4 
It was a square cavity with top moving wall and i set it's horizontal length equal to my porous media radius and the vertical equal to height/thickness of porous media.


December 29, 2022, 17:14 

#8 
Senior Member
andy
Join Date: May 2009
Posts: 276
Rep Power: 18 
Is your task to develop what may be a fairly challenging CFD code (need to know a bit more to say) without a relevant background in CFD or someone to talk to at your end that develops CFD? Is owning the code important or can you use commercial and/or opensource CFD codes to solve the problem?


December 30, 2022, 00:30 

#9 
New Member
tara behmanesh
Join Date: Jul 2022
Posts: 13
Rep Power: 4 
It wasn't a must to develop code (actually i first think to use ansys fluent but i wasn't familiar with it at all and that way i didn't know how to implement diffusionreaction and growth equations.) however i was familiar with matlab and i discretized the 2 eqs (using method of lines )and i have 2 odes that should be solved simultaneously with velocity equation.
On that time the discretization seemd easy and straightforward to me (so i though that's it i'm going to solve 3 time dependent odes by a solver like ode15 or something and the problem will be solved ,at that moment i didn't even heard of pressurevelocity coupling ) now i think it was a pretty good decision cause if i started with a commercial software probably never understand what's going on the background A question: After i cared for the boundary conditions as you said, then solving pressurevelocity on staggered grid and then having vlocity and pressure on actual nodes, am i allowed to implement the discretized odes (diffusionreaction and growth) on actual nodes and solve them simultaneously with velocity? Or should i use another discretization method or is there something that i'm doing wrong? Thanks a lot 

December 30, 2022, 03:56 

#10 
Senior Member
andy
Join Date: May 2009
Posts: 276
Rep Power: 18 
There would seem to be quite a lot you are doing wrong but without knowing the objectives of your project and your working environment listing them will be difficult.
A staggered grid approach develops increasing problems if you need to accurately resolve boundaries. If boundaries can be a bit vague you will need to introduce a method to represent them and probably resolve them better than the internal flow because this is where the gradients are largest. Your reactions will be changing the energy balance so you will need to solve for an energyrelated transport equation with which one depending on other factors. Reactions will be changing the composition of your material and so you will likely need transport equations for them. Etc... All these additional numerical methods will have numerical issues like pressure/velocity decoupling, stiffness preventing convergence, large variations in scales preventing resolution forcing more modelling assumptions, etc... The easy option is to take a commercial or open source program in which all or almost all this has been implemented in many many lines of code and then read about what has been implemented while running some test cases to check. The hard and very time consuming option is to research and develop until you have implemented those many many lines of code over a period of years. Without doing this in a group of others developing CFD codes and knowledgeable supervisor/s will make it much more frustrating and lengthy. An intermediate approach is perhaps to construct your program using a scripting language and functions from libraries/toolkits while writing the odd low level routine for missing functionality. If you want to learn and have the time then using open source code rather than matlab is likely to be more fruitful in the longer term but this brings us back to the project objectives. 

December 30, 2022, 04:29 

#11  
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,809
Rep Power: 72 
Quote:
Sorry but I have to say you are on the wrong way. You have a system of coupled PDE, hyperbolic in the divergencefree constraint and parabolic in the momentum equation. This latter can be discretized in space and then you can use a semidiscrete time integration (method of line) but that is just one component of the full formulation. You have to consider the fact that the pressure equation is derived from the continuity, not from a thermodynamic law. Consequently the BCs for the pressure must satisfy a condition for the existence of a solution for the Poisson problem with Neumann conditions. What CFD textbook have you read for this topic? Your time will be lost if you simply think to extend the experience you had on ODE using Matlab. 

December 30, 2022, 05:31 

#12 
New Member
tara behmanesh
Join Date: Jul 2022
Posts: 13
Rep Power: 4 
Oh..
Thanks a lot to both of you. At least now i know that i was wasting my time reading on internet and watching some YouTube aiming to learn CFD (by learning some numerical techniques) while i was not aware of nature of the problem and equations that i wanted to solve. I wish i did asked sooner. And kindly can you introduce a good source to start learning CFD? 

December 30, 2022, 05:43 

#13  
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,809
Rep Power: 72 
Quote:
There is no unique textbook to learn CFD, you can go reading  Anderson  Ferziger, Peric and Street.  Blazek A further good reading is https://www.amazon.it/IntroductionC...81129660&psc=1 

December 30, 2022, 07:52 

#14  
Senior Member
andy
Join Date: May 2009
Posts: 276
Rep Power: 18 
Quote:
I would suggest defining a few test problems covering the breadth of the physics your are interested in. Finding a few existing CFD programs that can solve all or some of them. Choosing at least two, setting up and running the simulations and comparing the results. At this stage you won't know how reliable the simulations might be or be fully one top of what is going on but you will have information and evidence in front of you to guide the process of studying what is going on and what is or is not important. If you have access to commercial programs like comsol and fluent they should be the quickest way to get going. Open source programs like OpenFOAM or equivalents are likely to require a bit more effort to get results but should expose you a bit more to what is going on. The next level down is linking together research packages like petsc, mfem, fenics, chemkin,... with a scripting language like python, matlab,... or a small wrapper in a compiled language like C++. Probably only useful if you want to develop your own code. 

Tags 
boundary condition, porous domain, pressure b.c, velocity and pressure, velocity bc 
Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Problem on boundary conditions (multiphase, porous media, 3 flow domains)  Juun  FLUENT  1  November 19, 2023 01:06 
A solver for twophase flow with a porous media  enoch  OpenFOAM Programming & Development  6  October 10, 2022 09:11 
How do model two phase granular flow in Porous media?  bahman  FLUENT  1  December 6, 2012 04:39 
compressible flow through porous media  Chirag2302  FLUENT  0  March 2, 2012 23:13 
Fluid flow in porous media question  Orlando  FLUENT  2  September 12, 2001 10:31 