porous media models
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. |
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 :D and give idea from other libraries |
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:
|
it is :
Code:
laplacian(mu,U) |
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:
|
is it a 2D simulation or 3D ?
|
it's 3D simulation
Quote:
|
I have to generate this kind of derivatives?
|
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
|
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:
|
All times are GMT -4. The time now is 11:02. |