CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

porous media models

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   November 29, 2013, 11:23
Post porous media models
  #1
Member
 
Reza
Join Date: Feb 2012
Posts: 63
Rep Power: 5
gooya_kabir is on a distinguished road
Hi Dear FOAMers,

I'm working on modification of porous media models in OF. I'm trying to change Darcy-Forchheimer model, in new model there is second derivatives of U in x and y direction. It seems that source term for Darcy-Forchheimer model is defined in src/finiteVolume/cfdTools/general/porosityModels as follow:

forAll(cells, i)
{
const label cellI = cells[i];

const tensor Cd = mu[cellI]*D + (rho[cellI]*mag(U[cellI]))*F
const scalar isoCd = tr(Cd);

Udiag[cellI] += V[cellI]*isoCd;
Usource[cellI] -= V[cellI]*((Cd - I*isoCd) & U[cellI]);
}
, which D and F are constants of model.
Now, I want to change the second part of Cd, ((rho[cellI]*mag(U[cellI]))*F) to
mu * ((d2U/dx2)+(d2U/dy2)).

My questions are:
mag(U[cellI]) means that it's not a vector more?
What is difference of U and V?
I tried to apply laplacian U in second part of Cd, but it seems laplacian and div cannot be read here since we did not define argc and argv, right?
and finally, if it's not possible to apply derivatives here, how can I change the model?

Thank you in advance for your help and comments.
gooya_kabir is offline   Reply With Quote

Old   December 1, 2013, 12:04
Default
  #2
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
1- mag returns the magnitude the vector
2-what is V? you should look the source code to find it
3-obviously you are not supposed to do such an action, because laplacian operator is defined for volField variable not an specific scalar
4- to general question

i suggest, first of all, you start to find how the existing model works , then try to adapt your own code, OpenFOAM is Open-source code, so dont limit your self to a specific part of it, read code from every where and give idea from other libraries
__________________
Training Course on OpenFOAM at (http://www.isme.ir/)
My Weblog (http://openfoam.blogfa.com/)
nimasam is offline   Reply With Quote

Old   December 2, 2013, 11:10
Default
  #3
Member
 
Reza
Join Date: Feb 2012
Posts: 63
Rep Power: 5
gooya_kabir is on a distinguished road
Thank you for help. just an easy question (maybe!), what's the mathematical description of below equation in OF???

mu * (d2U/dx2)+(d2U/dy2)

(it's a 3-d structure and we have z direction also)

Quote:
Originally Posted by nimasam View Post
1- mag returns the magnitude the vector
2-what is V? you should look the source code to find it
3-obviously you are not supposed to do such an action, because laplacian operator is defined for volField variable not an specific scalar
4- to general question

i suggest, first of all, you start to find how the existing model works , then try to adapt your own code, OpenFOAM is Open-source code, so dont limit your self to a specific part of it, read code from every where and give idea from other libraries
gooya_kabir is offline   Reply With Quote

Old   December 2, 2013, 11:17
Default
  #4
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
it is :
Code:
laplacian(mu,U)
if mu multiples in the whole terms
__________________
Training Course on OpenFOAM at (http://www.isme.ir/)
My Weblog (http://openfoam.blogfa.com/)
nimasam is offline   Reply With Quote

Old   December 2, 2013, 11:25
Default
  #5
Member
 
Reza
Join Date: Feb 2012
Posts: 63
Rep Power: 5
gooya_kabir is on a distinguished road
so, what's the difference between:
(d2U/dx2) + (d2U/dy2) + (d2U/dz2) and (d2U/dx2) + (d2U/dy2) ?
I thought laplacian means : laplacian (U)=(d2U/dx2) + (d2U/dy2) + (d2U/dz2)
and I just want the first two terms!
Quote:
Originally Posted by nimasam View Post
it is :
Code:
laplacian(mu,U)
if mu multiples in the whole terms
gooya_kabir is offline   Reply With Quote

Old   December 2, 2013, 14:53
Default
  #6
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
is it a 2D simulation or 3D ?
__________________
Training Course on OpenFOAM at (http://www.isme.ir/)
My Weblog (http://openfoam.blogfa.com/)
nimasam is offline   Reply With Quote

Old   December 2, 2013, 15:26
Default
  #7
Member
 
Reza
Join Date: Feb 2012
Posts: 63
Rep Power: 5
gooya_kabir is on a distinguished road
it's 3D simulation
Quote:
Originally Posted by nimasam View Post
is it a 2D simulation or 3D ?
gooya_kabir is offline   Reply With Quote

Old   December 3, 2013, 08:30
Default
  #8
Member
 
Reza
Join Date: Feb 2012
Posts: 63
Rep Power: 5
gooya_kabir is on a distinguished road
I have to generate this kind of derivatives?
gooya_kabir is offline   Reply With Quote

Old   December 3, 2013, 09:24
Default
  #9
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
i guess so, you need to modify a higher classes, see source code how laplacian has been implemented , i guess you need to follow the similar approach to implement your special laplacian
__________________
Training Course on OpenFOAM at (http://www.isme.ir/)
My Weblog (http://openfoam.blogfa.com/)
nimasam is offline   Reply With Quote

Old   December 4, 2013, 10:19
Default
  #10
Member
 
Reza
Join Date: Feb 2012
Posts: 63
Rep Power: 5
gooya_kabir is on a distinguished road
again Hi
I tried to search the web and also OF to see what I can get. In src/finiteVolume/finiteVolume directory, there are two directory with laplacian 1)laplacianSchemes* and 2)fvm/fvmLaplacian*
when I want to change the laplacian procedure, probably I have to change all parts(1, 2)?
and also when I want to change fvm/fvmLaplacian(2), there is no file related to this in original Make/files to copy it into my run directory, am I right? what could I do?
and when I want to use new laplacian, I should add the library into my solver.C? since it make error when I add this : libs ("libmyfiniteVolume.so")?!
Quote:
Originally Posted by nimasam View Post
i guess so, you need to modify a higher classes, see source code how laplacian has been implemented , i guess you need to follow the similar approach to implement your special laplacian
gooya_kabir is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to model granular flow through porous media Axius FLUENT 2 August 7, 2014 10:34
Porous media setup issues in Fluent Bernard Van FLUENT 22 June 6, 2014 05:52
where to input the particle or fiber diameter D with Porous Media Models digoy FLOW-3D 0 October 17, 2013 22:38
porous media: Fluent or Star-CD? Igor Main CFD Forum 0 December 5, 2002 16:16
Porous Media models in commercial CFD Clif Upton Main CFD Forum 1 April 17, 2002 14:06


All times are GMT -4. The time now is 23:10.