
[Sponsors] 
November 29, 2013, 11:23 
porous media models

#1 
Member
Reza
Join Date: Feb 2012
Posts: 63
Rep Power: 5 
Hi Dear FOAMers,
I'm working on modification of porous media models in OF. I'm trying to change DarcyForchheimer model, in new model there is second derivatives of U in x and y direction. It seems that source term for DarcyForchheimer 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

1 mag returns the magnitude the vector
2what is V? you should look the source code to find it 3obviously 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 Opensource 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/) 

December 2, 2013, 11:10 

#3  
Member
Reza
Join Date: Feb 2012
Posts: 63
Rep Power: 5 
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 3d structure and we have z direction also) Quote:


December 2, 2013, 11:17 

#4 
Senior Member

it is :
Code:
laplacian(mu,U)
__________________
Training Course on OpenFOAM at (http://www.isme.ir/) My Weblog (http://openfoam.blogfa.com/) 

December 2, 2013, 11:25 

#5 
Member
Reza
Join Date: Feb 2012
Posts: 63
Rep Power: 5 
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! 

December 2, 2013, 14:53 

#6 
Senior Member

is it a 2D simulation or 3D ?
__________________
Training Course on OpenFOAM at (http://www.isme.ir/) My Weblog (http://openfoam.blogfa.com/) 

December 2, 2013, 15:26 

#7 
Member
Reza
Join Date: Feb 2012
Posts: 63
Rep Power: 5 

December 3, 2013, 08:30 

#8 
Member
Reza
Join Date: Feb 2012
Posts: 63
Rep Power: 5 
I have to generate this kind of derivatives?


December 3, 2013, 09:24 

#9 
Senior Member

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/) 

December 4, 2013, 10:19 

#10 
Member
Reza
Join Date: Feb 2012
Posts: 63
Rep Power: 5 
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")?! 

Thread Tools  
Display Modes  


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  FLOW3D  0  October 17, 2013 22:38 
porous media: Fluent or StarCD?  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 