|
[Sponsors] |
November 10, 2014, 13:03 |
Inhomogeneous Porous Media
|
#1 |
New Member
Marco
Join Date: Nov 2014
Location: Germany
Posts: 14
Rep Power: 12 |
I want to define a source term field via the fvOptions on the rhs of a momentum equation. I know my porous intertial and viscous resistance tensor as a function of space dimensions: D_.value(x,y) and F_.value(x,y), so in each cell, the resulting resistance tensor has different values. How could I create a tensor field, that I can hand over to the momentum equation? Is it possible to create a function that will fill the tensorField? E.g. where could I define something like this, preferably without having to recompile the solver:
Code:
porosity1 { type explicitPorositySource; active yes; selectionMode cellZone; cellZone porosity; explicitPorositySourceCoeffs { type DarcyForchheimer; DarcyForchheimerCoeffs { forAll(cells,i) { d.value[i].xx = 12.34*cells[i].coordinates.x d.value[i].yy = 43.21*cells[i].coordinates.y+2 d.value[i].zz = 1e6 f.value[i].xx = 4.567*cells[i].coordinates.x f.value[i].yy = 654.3*cells[i].coordinates.y+6 f.value[i].zz = 1e6 } coordinateSystem { e1 (1 0 0); e2 (0 1 0); } } } } |
|
March 3, 2015, 11:52 |
|
#2 |
New Member
Marco
Join Date: Nov 2014
Location: Germany
Posts: 14
Rep Power: 12 |
Ok, i found the solution to my problem. I modified the original DarcyForchheimerTemplates.C file and added a function that returns the coefficients based on some of the flow parameters in each cell (http://foam.sourceforge.net/docs/cpp/a04765_source.html).
Code:
forAll(cellZoneIDs_, zoneI) { const labelList& cells = mesh_.cellZones()[cellZoneIDs_[zoneI]]; forAll(cells, i) { const label cellI = cells[i]; //coordinates of the cell const scalar params.xCoor = mesh_.C().component(vector::X)()[cellI]; const scalar params.yCoor = mesh_.C().component(vector::Y)()[cellI]; //Volume averaged velocity of the cell const scalar params.ux = mag(Uv.internalField()[cellI].x())*alphav.internalField()[cellI] + mag(Ul.internalField()[cellI].x())*(1-alphav.internalField()[cellI]); const scalar params.uy = mag(Uv.internalField()[cellI].y())*alphav.internalField()[cellI] + mag(Ul.internalField()[cellI].y())*(1-alphav.internalField()[cellI]); const tensor Cd = Functions::calcCd(params); const scalar isoCd = tr(Cd); Udiag[cellI] += V[cellI]*isoCd; Usource[cellI] -= V[cellI]*((Cd - I*isoCd) & U[cellI]); } } |
|
March 3, 2015, 11:59 |
|
#3 |
New Member
Marco
Join Date: Nov 2014
Location: Germany
Posts: 14
Rep Power: 12 |
Now, another thing that I dont't really understand:
Can someone explain what the sense behind this method of adding the source term is? Code:
Udiag[cellI] += V[cellI]*isoCd; Usource[cellI] -= V[cellI]*((Cd - I*isoCd) & U[cellI]); Code:
(template<class RhoFieldType> void Foam::porosityModels::DarcyForchheimer::apply tensorField& AU, const RhoFieldType& rho, const scalarField& mu, const vectorField& U ) |
|
July 16, 2016, 16:05 |
|
#4 | |
New Member
exw599
Join Date: Jan 2016
Posts: 6
Rep Power: 10 |
Quote:
I am facing a similar problem like you, I need to simulate the flow past the porous media where permeability is not uniform over space. "DarcyForchheimerTemplates.C" is in src folder, are there any other solutions to this problem? Because as I know if you change the source code you have to recompile it which is not so easy for me. Cheers |
||
December 16, 2020, 14:33 |
|
#5 |
Senior Member
alberto
Join Date: Apr 2016
Location: Mexico
Posts: 119
Rep Power: 10 |
Hi,
Did you find a way to use a permeability dependent position? |
|
Tags |
fvoptions, porous domain, porous media, porous modellling |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Multiphase Porous Media Flow - Convergence Issues | VT_Bromley | FLUENT | 8 | May 30, 2024 03:59 |
Porous media setup issues in Fluent | Bernard Van | FLUENT | 29 | January 26, 2017 05:09 |
How to model granular flow through porous media | Axius | FLUENT | 2 | August 7, 2014 11:34 |
species mass source in porous media ? | PK | FLUENT | 0 | February 16, 2007 12:12 |
porous media: Fluent or Star-CD? | Igor | Main CFD Forum | 0 | December 5, 2002 16:16 |