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

Setting a mass flow with periodic boundary conditions (3D)

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By linnemann

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 4, 2022, 08:33
Default Setting a mass flow with periodic boundary conditions (3D)
  #1
New Member
 
Felix Asch
Join Date: Dec 2021
Posts: 2
Rep Power: 0
Flex is on a distinguished road
Dear Foamers,

I have a problem with setting a certain mass flow rate when using periodic boundary conditions in a 3D domain. I have already read various threads with similar topics, however I have not been able to find a suitable solution yet, as my problem is a bit more specific.


Here some information about my problem:
I am trying to simulate the polymer melt (non-Newtonian) in a twin screw extruder using OpenFOAM (V9 or V2112). I have a geometry conform computational mesh with the following patches: inlet, outlet, both screws (screw_l and screw_r) and the housing_wall, and the fluid domain see attached picture.

For this I simulate a small section (half conveying element) and use periodic boundary conditions (cyclic) at the inlet and outlet.
The goal is to simulate this steady-state, incompressible, isothermal and laminar with simpleFoam at a constant screw speed of 60 rpm in order to calculate the dimensionless ratios according to Pawlowski.

For the velocity (0/U) boundary conditions, I use the cylindricalInletVelocity boundary condition on the screws to set the speed. For the adhesion condition, I use noSlip or fixedValue uniform (0 0 0) on the housing wall. Inlet and outlet are defined as cyclic.

Code:
dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 0 0);

boundaryField
{
    INLET
    {
        type            cyclic;
    }

    OUTLET
    {
        type            cyclic;
    }

    SCREW_L
    {
        type            cylindricalInletVelocity;
        value        uniform (0 0 0);     
        origin          (0.0167 0 0.01);
        axis            (0 0 1);
        axialVelocity   constant 0;      
        radialVelocity  constant 0;   
        rpm             constant -60;    
    }

    SCREW_R
    {
        type            cylindricalInletVelocity;
        value          uniform (0 0 0);     
        origin          (-0.0167 0 0.01);
        axis            (0 0 1);
        axialVelocity   constant 0;    
        radialVelocity  constant 0;    
        rpm             constant -60;    
    }

    WALL
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }    
}
For the pressure boundary conditions (0/p) it gets a bit tricky, because the boundary conditions for the inlet and outlet have to be cyclic as well. The remaining patches (Screw_l, Screw_r and Housing_wall) should be zeroGradient in my opinion. That means I don't have a pressureInlet/ pressureOutlet per se.
Code:
dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    INLET
    {
        type            cyclic;
    }

    OUTLET
    {
        type            cyclic;
    }

    SCREW_L
    {
        type            zeroGradient; 
     }

    SCREW_R
    {
        type            zeroGradient;
    }

    WALL
    {
        type            zeroGradient;
    }    
}


The direction of flow is the z-axis. For a flow to occur, I want to specify a mass flow or a velocity component in the flow direction (v_z) over the cross-sectional area of my flow channel, so that a pressure gradient is formed and I get a pressure driven flow. Via fvOptions and (patch-)MeanVelocity (patch = outlet) with Ubar (0 0 v_z) a flow is formed and the solution converges.
Code:
momentumSource
{
    type           patchMeanVelocityForce; 
    active         on;  
 
    patchMeanVelocityForceCoeffs
    {
    selectionMode    all;
    fields        (U);
    patch        OUTLET; 
    Ubar        (0 0 v_z); 
    }
}

My problem now is that the velocity component v_z in the fvOptions (Ubar) cannot be set smaller than 0.2 m/s, otherwise the simulation stops with the follwoing error message:


Code:
FOAM FATAL ERROR: 
Continuity error cannot be removed by adjusting the outflow.
Please check the velocity boundary conditions and/or run potentialFoam to initialise the outflow.
Total flux              : 9.75213e-05
Specified mass inflow   : 5.87128e-05
Specified mass outflow  : 5.87129e-05
Adjustable mass outflow : 0


    From function bool Foam::adjustPhi(Foam::surfaceScalarField&, const volVectorField&, Foam::volScalarField&)
    in file cfdTools/general/adjustPhi/adjustPhi.C at line 107.

FOAM exiting

I also tried to run potentialFoam to initialise a flow but that did not work as planned.
The problem now is, that i need flow velocities (v_z) smaller than 0.2 m/s in order to specify a certain mass flow rate from experimental values. Here I do not yet understand the direct connection between the size of the velocity component (v_z) in the fvOptions and the termination of the simulation.


Is there perhaps an alternative to the function meanVelocity in the fvOptions, with which I can directly set a pressure gradient or a mass flow rate?

I would be very grateful for any tips or hints.

Have a nice day

Felix
Attached Images
File Type: jpg Pic_geom_cfd-online.jpg (50.3 KB, 47 views)
Flex is offline   Reply With Quote

Old   April 5, 2022, 15:07
Default
  #2
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
Hi


Since you are using cyclic would it be possible to use the cyclic fan BC?


https://www.openfoam.com/documentati...-jump-fan.html


I've used ot for pumps/fans, if you have some experimental values you can input your own "Pump/fan" curve.


Some of the other coupled BC's could be an option.


https://www.openfoam.com/documentati...onditions.html


Maybe the mappedFlowRate


How to properly use mappedFlowRate
Flex likes this.
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   April 10, 2022, 13:46
Thumbs up
  #3
New Member
 
Felix Asch
Join Date: Dec 2021
Posts: 2
Rep Power: 0
Flex is on a distinguished road
Hi linneman, first of all big thanks for your tips.

I have spent the last few days trying different boundary conditions, hence the late reply. It seems that the mappedFlowRate BC is what I was looking for.

I have now mapped the FlowRate of the Outlet to the Inlet. Meaning, what flows out of the outlet flows right back into the inlet, giving me periodicity of the geometry as well (i hope i understood that right?).

The mass flows confirm this assumption (massflow_outlet at t=1 corresponds to massflow_inlet at t=2, and so on, see attached figure MassFlow_1) if the BC are chosen as follows for the Inlet and Outlet:
0/p:

Code:
inlet_new
    {
    type            zeroGradient;
    }

OUTLET
    {
        type        fixedValue;
        value        uniform 0;
   }
0/U:

Code:
inlet_new
    {
        type            mappedFlowRate;
        phi             phi;
        rho             rho;
        neigPhi         phi;
        value           uniform (0 0 0); // placeholder
    }

OUTLET
    {
        type        zeroGradient;
   }
If we consider a non-periodic case, like a simple pipe flow, the boundary conditions for the inlet and outlet are defined as follows according to the literature:

-Inlet as VelocityInlet and Outlet as PressureOutlet.

This should be satisfied for the constraints shown above?!

First, I would like to calculate a mass flow m0 for the condition: Pressure gradient = 0 (over my entire geometry) This should correspond to the pure drag conveying capacity of the twin screw extruder.

The problem is that I have not yet found any suitable boundary conditions or settings, with which a simulation without pressure gradient (pressure gradient = 0) can be carried out.
Is there an option for this such as in the fvOptions or can this also be done by setting the boundary condition correctly?
With the BC shown above my results are smaller than the reference values by a factor of 10.

After i got m0, I would like to specify 10-90%*m0 (for example, at the inlet at t=0), which creates a pressure gradient that in turn affects the mass flow m that forms.

Surely this should be possible by specifying a starting value vz at my mappedFlowRate?

Code:
inlet_new
    {
        type            mappedFlowRate;
        phi             phi;
        rho             rho;
        neigPhi         phi;
        value           uniform (0 0 0.02); // placeholder
    }
In a short test run, I was able to use this to set a mass flow at the inlet for t=0, see figure MassFlow_2. The Problem i see right now is that for t=1 the Massflow of the Outlet (value 0) is mapped to the Inlet which disturbs the flow that forms between inlet and outlet between t=0 and t=1.

Any Ideas how i can fix this?

Many thanks in advance
Felix
Attached Images
File Type: png MassFlows_1.png (49.5 KB, 21 views)
File Type: png MassFlow_2.png (37.1 KB, 13 views)
Flex is offline   Reply With Quote

Reply

Tags
fvoptions, mass flow rate, openfoam, periodic bc


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
Issues on the simulation of high-speed compressible flow within turbomachinery dowlee OpenFOAM Running, Solving & CFD 11 August 6, 2021 07:40
CFD analaysis of Pelton turbine amodpanthee CFX 31 April 19, 2018 19:02
Question about adaptive timestepping Guille1811 CFX 25 November 12, 2017 18:38
Basic Nozzle-Expander Design karmavatar CFX 20 March 20, 2016 09:44
Low torque values on Screw Turbine Shaun Waters CFX 34 July 23, 2015 09:16


All times are GMT -4. The time now is 05:43.