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

anisotropic porous media in OpenFOAM

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

Like Tree1Likes
  • 1 Post By Hisham

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 23, 2012, 18:47
Default anisotropic porous media in OpenFOAM
  #1
Member
 
,...
Join Date: Apr 2011
Posts: 92
Rep Power: 14
hawkeye321 is an unknown quantity at this point
Does anyone have any experience in simulating flow in an-isotropic porous media in OF? I mean simulations in which the permeability in x direction is different from the permeability in y direction.

My main problem is that when I am adding the darcy soource term as
+ ((1/Perm)*(fvm::Sp(Visc,U)))

I do not know how to tell the OF that Perm will be different based on the direction!

comments are appreciated!
hawkeye321 is offline   Reply With Quote

Old   October 24, 2012, 04:48
Default
  #2
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
hi mahdi
is in this condition permeability ("Prem") a vectorField?

if yes, you can define a volVectorField for Prem, then
assign your directional variation with setFields in 0 folder
nimasam is offline   Reply With Quote

Old   October 24, 2012, 09:37
Default Permeability Vector
  #3
Member
 
,...
Join Date: Apr 2011
Posts: 92
Rep Power: 14
hawkeye321 is an unknown quantity at this point
Hi nimasam
Thanks for the comment.
But, if I define the permeability as volVectorField then, when I want to multiply it by velocity what kind of vector multiplication do I have to use; definitely not inner or cross product. Right?
hawkeye321 is offline   Reply With Quote

Old   October 24, 2012, 09:52
Default
  #4
Senior Member
 
Hisham's Avatar
 
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17
Hisham is on a distinguished road
Hi Mahdi

In the case of non-isotropic permeability, the permeability is a symmetric tensor. For anisotropy, you should assign zero off-diagonal values and be left with kxx, kyy and kzz.

Hope this helps!

Regards
Hisham
Hisham is offline   Reply With Quote

Old   October 24, 2012, 09:57
Default multiplying permeability tensor and velocity vector
  #5
Member
 
,...
Join Date: Apr 2011
Posts: 92
Rep Power: 14
hawkeye321 is an unknown quantity at this point
Dear Hisham
Thanks for the comment. I know that true, but, as I mentioned in my previous post, I am not sure how to multiply permeability tensor and velocity vector in the momentum equation. What kind of multiplication operator do I have to use?
hawkeye321 is offline   Reply With Quote

Old   October 24, 2012, 10:26
Default
  #6
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
dear mahdi,
if you want to divide Ux/Kx , Uy/Ky , Uz/Kz
then i guess you may want to use some thing like this :
forAll(U,celli)
{
S[celli].x() = U[celli].x()/Kx[celli].x();
........
}
nimasam is offline   Reply With Quote

Old   October 24, 2012, 10:35
Default
  #7
Senior Member
 
Hisham's Avatar
 
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17
Hisham is on a distinguished road
I think you first would have to define the tensor as k (kxx 0 0 kyy 0 kzz), then get the inverse of the tensor as inv(k). The product should be an inner product: + (inv(k) & (fvm::Sp(Visc,U))

I would appreciate it if you report what happened!

Best regards,
Hisham
ashvinc9 likes this.
Hisham is offline   Reply With Quote

Old   October 24, 2012, 10:55
Default
  #8
Member
 
,...
Join Date: Apr 2011
Posts: 92
Rep Power: 14
hawkeye321 is an unknown quantity at this point
Dear Hisham
I have define a tensor named PermTenInv which has diagonal terms of 1/kxx,1/kyy and 1/kzz. Now when i am doing explicit calculations in form of

+ ((PermTen) & (fvc::Sp(Visc,U)))

there is no error. However, for implicit calculations in form of

((PermTen) & (fvm::Sp(Visc,U)))

I get the following error
--------------------------------------------------------------------
BR1IM003.C:84:40: error: no match for ‘operator&’ in ‘PermTen & Foam::fvm::Sp(const Foam::dimensionedScalar&, Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) [with Type = Foam::Vector<double>, Foam::dimensionedScalar = Foam::dimensioned<double>](((Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&)(& U)))’
/opt/openfoam171/src/OpenFOAM/lnInclude/wordI.H:167:19: note: candidates are: Foam::word Foam:perator&(const Foam::word&, const Foam::word&)
/opt/openfoam171/src/OpenFOAM/lnInclude/dimensionSet.H:273:29: note: Foam::dimensionSet Foam:perator&(const Foam::dimensionSet&, const Foam::dimensionSet&)
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:8:10: warning: unused variable ‘momentumPredictor’
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:11:10: warning: unused variable ‘transonic’
/opt/openfoam171/src/finiteVolume/lnInclude/readPISOControls.H:14:9: warning: unused variable ‘nOuterCorr’
make: *** [Make/linux64GccDPOpt/BR1IM003.o] Error 1
--------------------------------------------------------------------------
Unfortunately, I have to discretise this source term implicitly. Any ideas how to fix this error?
hawkeye321 is offline   Reply With Quote

Old   October 24, 2012, 11:23
Default
  #9
Senior Member
 
Hisham's Avatar
 
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17
Hisham is on a distinguished road
Dear Mahdi,

It is really sad that this did not work directly. You can report this as a bug (assuming a similar feature should be available). If you are highly motivated for your problem you can try to add a new fvm::Sp function to fvmSup.C/.H that can take a "dimensionedVector & sp" argument. You then have to dig deep into OpenFOAM's number crunching mechanisms and figure out which elements of fvm.diag() should you multiply by which component. Here ends my ideas. I hope you can find an easier solution!
Code:
template<class Type>
00153 Foam::tmp<Foam::fvMatrix<Type> >
00154 Foam::fvm::Sp
00155 (
00156     const dimensionedScalar& sp,
00157     const GeometricField<Type, fvPatchField, volMesh>& vf
00158 )
00159 {
00160     const fvMesh& mesh = vf.mesh();
00161 
00162     tmp<fvMatrix<Type> > tfvm
00163     (
00164         new fvMatrix<Type>
00165         (
00166             vf,
00167             dimVol*sp.dimensions()*vf.dimensions()
00168         )
00169     );
00170     fvMatrix<Type>& fvm = tfvm();
00171 
00172     fvm.diag() += mesh.V()*sp.value();
00173 
00174     return tfvm;
00175 }
Regards,
Hisham
Hisham is offline   Reply With Quote

Old   October 24, 2012, 12:44
Default
  #10
Member
 
,...
Join Date: Apr 2011
Posts: 92
Rep Power: 14
hawkeye321 is an unknown quantity at this point
THnaks Hisham. I am going to discuss it in a new post to be sure that this is a bug in OF.
hawkeye321 is offline   Reply With Quote

Old   September 16, 2013, 09:05
Default
  #11
Member
 
Anja Miehe
Join Date: Dec 2009
Location: Freiberg / Germany
Posts: 48
Rep Power: 16
AnjaMiehe is on a distinguished road
Hello Mhadi,

is there any progress in the subject? I am coding something similar for solidification and encounter the same problem.

Regards, Anja
AnjaMiehe is offline   Reply With Quote

Old   April 7, 2016, 03:34
Default
  #12
New Member
 
Vitor Geraldes
Join Date: Dec 2009
Location: Lisbon, Portugal
Posts: 26
Rep Power: 16
vitor.geraldes@ist.utl.pt is on a distinguished road
:::::::::::::::::::::::::::::::::::::::::

Last edited by vitor.geraldes@ist.utl.pt; April 8, 2016 at 19:48.
vitor.geraldes@ist.utl.pt is offline   Reply With Quote

Old   July 25, 2016, 16:20
Default Any solution?
  #13
New Member
 
Mateus Palharini Schwalbert
Join Date: May 2011
Posts: 22
Rep Power: 14
mateusps is on a distinguished road
Hi y'all,

I also need to implement an implicit anisotropic source term. Did anyone find a way to do that?

fvm::Sp seems to not accept a tensor as coefficient...

thanks
mateusps is offline   Reply With Quote

Old   July 25, 2016, 17:14
Default
  #14
New Member
 
Vitor Geraldes
Join Date: Dec 2009
Location: Lisbon, Portugal
Posts: 26
Rep Power: 16
vitor.geraldes@ist.utl.pt is on a distinguished road
Try to create an homogeneous hydrodynamic resistance and then subtract a given fraction (fAniso) in the direction nT (unitary vector):

+ fvm::Sp(Rmush,U)
- fAniso*Rmush*(U&nT)*nT

if fAniso is 1, the resistance in the direction nT is zero, if fAniso is 0 then you have no anisotropy.
vitor.geraldes@ist.utl.pt is offline   Reply With Quote

Old   July 25, 2016, 17:29
Default Didn't get it
  #15
New Member
 
Mateus Palharini Schwalbert
Join Date: May 2011
Posts: 22
Rep Power: 14
mateusps is on a distinguished road
Thanks for the reply, Vitor, but I didn't get it.

In your suggestion, what is Rmush? Because if it is a tensor, it does not work...

Maybe what you're suggesting is something I've already tried: to implement that in 2 terms, one implicit and isotropic, and one explicit and anisotric. But in my case it does not work, because the largest part of the resistance is specifically the anisotropic part, and any explicit treatment of that refuses to converge...
mateusps is offline   Reply With Quote

Old   July 25, 2016, 17:59
Default
  #16
New Member
 
Vitor Geraldes
Join Date: Dec 2009
Location: Lisbon, Portugal
Posts: 26
Rep Power: 16
vitor.geraldes@ist.utl.pt is on a distinguished road
Rmush is a volScalarField which may be computed for instance by the Kozeny Carman correlation.
vitor.geraldes@ist.utl.pt is offline   Reply With Quote

Old   July 25, 2016, 23:14
Default How to code the anisotropic heterogeneous source term as implicit?
  #17
New Member
 
Mateus Palharini Schwalbert
Join Date: May 2011
Posts: 22
Rep Power: 14
mateusps is on a distinguished road
Ok, but this way the anisotropic part is still explicit, right? Any way to code the anisotropic heterogeneous source term as implicit?
mateusps is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiphase Porous Media Flow - Convergence Issues VT_Bromley FLUENT 7 May 14, 2020 16:34
Can CFX treat anisotropic porous media? beginer CFX 2 May 8, 2013 02:10
Discrete phase modeling on porous media magnounibo FLUENT 0 April 9, 2009 08:18
Data for anisotropic porous media Arunav Gogoi Main CFD Forum 1 March 28, 2006 09:28
Porous media and convergence A.Joshi FLUENT 0 October 21, 2003 22:09


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