CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Help needed with pimpleDyMFoam case! (https://www.cfd-online.com/Forums/openfoam-solving/186548-help-needed-pimpledymfoam-case.html)

j_moulton April 21, 2017 16:10

Help needed with pimpleDyMFoam case!
 
Hi everyone,

I am attempting to build a case that can model some airflow into an out of an idealized bronchiole-alveolus. Some background: inhalation is the process of your diaphragm contracting, which causes a pressure drop between the alveolar sacs and the atmosphere, creating a rush in of air; exhalation is the same but works backwards (diaphragm expansion causes the alveoli to contract, forcing higher pressure which is equilibrated by air leaving the body).

To do this, I defined my dynamicMeshDict as
Code:

dynamicFvMesh  dynamicMotionSolverFvMesh;

motionSolverLibs ( "libfvMotionSolvers.so" );

solver          velocityLaplacian;

velocityLaplacianCoeffs
{
    diffusivity inverseDistance (alv1);
    diffusivity inverseDistance (alv2);
    diffusivity inverseDistance (alv3);
    diffusivity inverseDistance (alv4);
}

The boundary conditions are:

p:

Code:

dimensions      [0 2 -2 0 0 0 0];

internalField  uniform 0;

boundaryField
{
    inlet
    {
      type        uniformFixedValue;
      uniformValue sine;
      uniformValueCoeffs
      {
          frequency    1;
          amplitude    1;
          scale        1;  // Scale factor for wave
          level        0;  // Offset
      }
    }
    pipeWall
    {
    type          zeroGradient;
    }
    alv1
    {
      type        zeroGradient;
    }
    alv2
    {
      type        zeroGradient;
    }
    alv3
    {
      type        zeroGradient;
    }
    alv4
    {
      type        zeroGradient;
    }
    frontAndBack
    {
        type            empty;
    }
    defaultFaces
    {
        type            zeroGradient;
    }
}

U:

Code:

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

internalField  uniform (0 0 0);

boundaryField
{
    inlet
    {
      type        uniformFixedValue;
      uniformValue sine;
      uniformValueCoeffs
      {
          frequency    1;
          amplitude    1;
          scale        (1 0 0);  // Scale factor for wave
          level        (0 0 0);  // Offset
      }
    }
    pipeWall
    {
        type            zeroGradient;
    }
    alv1
    {
      type              zeroGradient;
    }
    alv2
    {
      type              zeroGradient;
    }
    alv3
    {
      type              zeroGradient;
    }
    alv4
    {
      type              zeroGradient;
    }
    frontAndBack
    {
        type            empty;
    }
    defaultFaces
    {
        type            zeroGradient;
    }
}

and

pointMotionU:

Code:

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

internalField  uniform (0 0 0);

boundaryField
{
    alv1
    {
      type oscillatingVelocity;
      omega 0.5;
      amplitude (-.25 .25 0);
      value uniform (0 0 0);
    }
    alv2
    {
      type oscillatingVelocity;
      omega 0.5;
      amplitude (.25 .25 0);
      value uniform (0 0 0);
    }
    alv3
    {
      type oscillatingVelocity;
      omega 0.5;
      amplitude (.25 -.25 0);
      value uniform (0 0 0);
    }
    alv4
    {
      type oscillatingVelocity;
      omega 0.5;
      amplitude (-.25 -.25 0);
      value uniform (0 0 0);
    }
    pipeWall
    {
        type            uniformFixedValue;
        uniformValue    constant (0 0 0);
    }
    inlet
    {
        type            uniformFixedValue;
        uniformValue    constant (0 0 0);
    }
    frontAndBack
    {
        type            empty;
    }
    defaultFaces
    {
        type            zeroGradient;
    }
}

I am stuck at making this work the way I want it to and I need some help and input from those that know OF (much) better than me. There should be a pressure gradient from the expanding walls out to the inlet, and there should be a gradient of velocity entering the inlet. I tried to force the flow by oscillating the velocity and pressure at the inlet, but it's still not coming up right.

Can someone please help me sort this out? Or explain to me where I'm failing. All case files are zipped & attached, a short .avi of the expanding geometry is included for reference.

Case pimpleDyMFoam: https://www.dropbox.com/s/cn1tt7i6ch...MFoam.zip?dl=0

Video of expanding geometry:
https://www.dropbox.com/s/9yeorfujey...nding.avi?dl=0 ( I have a low frequency set here, but you get the idea).


All times are GMT -4. The time now is 06:10.