porous media models

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

 November 29, 2013, 11:23 porous media models #1 Member   Reza Join Date: Feb 2012 Posts: 67 Rep Power: 7 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.

 December 1, 2013, 12:04 #2 Senior Member   Nima Samkhaniani Join Date: Sep 2009 Location: Tehran, Iran Posts: 1,213 Blog Entries: 1 Rep Power: 17 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 __________________ Telegram channel (https://telegram.me/openfoam4Iranian) My Weblog (http://openfoam.blogfa.com/) Training Course on OpenFOAM at (http://www.isme.ir/)

December 2, 2013, 11:10
#3
Member

Reza
Join Date: Feb 2012
Posts: 67
Rep Power: 7
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 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

 December 2, 2013, 11:17 #4 Senior Member   Nima Samkhaniani Join Date: Sep 2009 Location: Tehran, Iran Posts: 1,213 Blog Entries: 1 Rep Power: 17 it is : Code: `laplacian(mu,U)` if mu multiples in the whole terms __________________ Telegram channel (https://telegram.me/openfoam4Iranian) My Weblog (http://openfoam.blogfa.com/) Training Course on OpenFOAM at (http://www.isme.ir/)

December 2, 2013, 11:25
#5
Member

Reza
Join Date: Feb 2012
Posts: 67
Rep Power: 7
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 it is : Code: `laplacian(mu,U)` if mu multiples in the whole terms

 December 2, 2013, 14:53 #6 Senior Member   Nima Samkhaniani Join Date: Sep 2009 Location: Tehran, Iran Posts: 1,213 Blog Entries: 1 Rep Power: 17 is it a 2D simulation or 3D ? __________________ Telegram channel (https://telegram.me/openfoam4Iranian) My Weblog (http://openfoam.blogfa.com/) Training Course on OpenFOAM at (http://www.isme.ir/)

December 2, 2013, 15:26
#7
Member

Reza
Join Date: Feb 2012
Posts: 67
Rep Power: 7
it's 3D simulation
Quote:
 Originally Posted by nimasam is it a 2D simulation or 3D ?

 December 3, 2013, 08:30 #8 Member   Reza Join Date: Feb 2012 Posts: 67 Rep Power: 7 I have to generate this kind of derivatives?

 December 3, 2013, 09:24 #9 Senior Member   Nima Samkhaniani Join Date: Sep 2009 Location: Tehran, Iran Posts: 1,213 Blog Entries: 1 Rep Power: 17 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 __________________ Telegram channel (https://telegram.me/openfoam4Iranian) My Weblog (http://openfoam.blogfa.com/) Training Course on OpenFOAM at (http://www.isme.ir/)

December 4, 2013, 10:19
#10
Member

Reza
Join Date: Feb 2012
Posts: 67
Rep Power: 7
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 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

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Bernard Van FLUENT 29 January 26, 2017 05:09 Axius FLUENT 2 August 7, 2014 10:34 digoy FLOW-3D 0 October 17, 2013 22:38 Igor Main CFD Forum 0 December 5, 2002 16:16 Clif Upton Main CFD Forum 1 April 17, 2002 14:06

All times are GMT -4. The time now is 19:42.