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

Diffusive flux in porous structure doesn't converge with smaller mesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 21, 2021, 03:53
Default Diffusive flux in porous structure doesn't converge with smaller mesh
  #1
Member
 
Adam
Join Date: Nov 2018
Posts: 36
Rep Power: 8
Adam_K is on a distinguished road
Hello,

I've been banging my head trying to figure this out and was hoping that someone here could help shed some light on my issue.

My overall goal is the simulate the diffusion across a porous film defined by the interparticle spaces in a spherical compact. I start with a solid matrix, and then subtract a series of spheres, leaving me with a continuous mesh around the sphereical pores. Before subtracting the spheres, the sphere-sphere contact points are "trimmed" in order to avoid the issues associated with meshing the contact points (see this article for more info). Here is an example image, only the sphere-matrix interface is shown for simplicity. The smallest spheres have a radius of 1 cm:



I set-up my case using the files at the end of this post and the solve it using laplacianFoam. After completion I run the command
Code:
postProcess -func 'patchIntegrate(name=Bottom,gradTz)' -latestTime |grep 'areaIntegrate(Bottom)'
in order to calculate the integrated flux across the bottom patch (I also do this for the top patch). The flux is then used to calculate the effective diffusivity of the medium.

When I mesh using gmsh and then run the OpenFOAM simulation (files at the end), for a range of mesh critical lengths I get the following results. For smaller mesh lengths, the overall volume of the mesh and the surface area of the top and bottom surfaces start to converge and there isn't much change. However, the integrated flux divided does not converge with the mesh critical length.



Here is my O/T file
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 -3 0 0 1 0 0];

internalField   uniform 0.08;

boundaryField
{
    Top
    {
        type            fixedValue;
        value           uniform 0.16;
    }
    Bottom
    {
        type            fixedValue;
        value           uniform 0;
    }
    Left
    {
        type            zeroGradient;
    }
    Right
    {
        type            zeroGradient;
    }
    Back
    {
        type            zeroGradient;
    }
    Front
    {
        type            zeroGradient;
    }
    Interior
    {
        type            zeroGradient;
    }
}

// ************************************************************************* //
And fvSchemes
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default         steadyState;
}

gradSchemes
{
    default         Gauss linear;
    grad(T)         Gauss linear;
}

divSchemes
{
    default         none;
}

laplacianSchemes
{
    default         none;
    laplacian(DT,T) Gauss linear orthogonal;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

fluxRequired
{
    default         yes;
    T               ;
}


// ************************************************************************* //
and fvSolution
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    T
    {
        preconditioner  FDIC;
		solver          GAMG;
		mergeLevels		1;
		smoother 		GaussSeidel;
		agglomerator	faceAreaPair;
		nCellsInCoarsestLevel	2;
        nPreSweeps 		3;
		nPostSweeps		2;
		nFinestSweeps	2;
        tolerance       1e-10;
        relTol          0;
    }
}

SIMPLE
{
//    nNonOrthogonalCorrectors 2;
	consistent 	yes;	
	 residualControl
    {
        T               1e-9;
    }
}


// ************************************************************************* //
and controlDict
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     laplacianFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         10;

deltaT          1;

writeControl    timeStep;

writeInterval   1;

purgeWrite	2;

writeFormat     binary;

writePrecision  32;

writeCompression uncompressed;

timeFormat      general;



// ************************************************************************* //
Adam_K is offline   Reply With Quote

Reply


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
Overset mesh for Fluid Structure Interaction in OpenFOAM Thaw Tar OpenFOAM Programming & Development 4 August 25, 2023 18:56
[snappyHexMesh] non uniform mesh near the stl object vava10 OpenFOAM Meshing & Mesh Conversion 0 January 31, 2021 15:41
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 07:09
Mesh interfaces and reactions in porous media - why not working? RossFS FLUENT 0 December 15, 2013 06:40
Icemcfd 11: Loss of mesh from surface mesh option? Joe CFX 2 March 26, 2007 19:10


All times are GMT -4. The time now is 08:03.