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

Implementing Pseudo-Parabolic Velocity Profile at Inlet with Irregular Cross-Section

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 22, 2024, 13:30
Default Implementing Pseudo-Parabolic Velocity Profile at Inlet with Irregular Cross-Section
  #1
New Member
 
Luca Muratori
Join Date: May 2024
Posts: 1
Rep Power: 0
Ghukka is on a distinguished road
Hello fellow Foamers,

I'm currently working on a simulation involving passive transport of particles inside a mesh representing the left atrium. I'm using OpenFOAM version 11 with its new modular architecture. I've successfully compiled a custom module for the foamRun application with the appropriate equations, and it has been tested on a simpler 2D case with satisfactory results.

However, I am facing challenges in setting up a pseudo-parabolic velocity profile at the inlets. The inlets have oval-shaped cross-sections, but they are not perfectly regular. My goal is to create a normalized pseudo-parabolic scalar distribution by solving a Poisson problem of the form -Δ𝑍 = 1, where 𝑍=0 at the boundary. I would then multiply this distribution by a maximum velocity value (obtained experimentally and retrieved from an external file) to approximate a parabolic velocity profile similar to that in a circular tube.

I've tried initializing the velocity field U at the inlet using the codedFixedValue boundary condition. My idea was to create an auxiliary field 𝑍, and another auxiliary field representing the source term (constant at −1). I would then solve the Poisson problem using these fields since fvm::laplacian(Z) requires a volScalarField. The resulting values of Z, when multiplied by Umax, would give the correct initial values for U.

However I don't know how to proceed. I'm not even sure this path is viable since I don't know how to set initial conditions for solving the Poisson problem in the first place. I tried solving the equation anyway, since maybe it could have thrown any meaningful error

Code:
boundaryField
{
    ...
    ...
    inlet
    {
        type    codedFixedValue;
        value   uniform (0 0 0);
        name   codedStuff;
        code
        #{
            ....
            ....
            volScalarField Z 
            ( 
                IOobject 
                ( 
                    "Z", 
                    runTime.name(), 
                    mesh, 
                    IOobject::NO_READ, 
                    IOobject::AUTO_WRITE 
                ), 
                mesh, 
                dimensionedScalar("zero", dimensionSet(0, 2, 0, 0, 0, 0, 0), 0.0),             "fixedValue" 
            ); 
			 
            volScalarField sourceTerm 
            ( 
                IOobject 
                ( 
                    "sourceTerm", 
                    runTime.name(), 
                    mesh, 
                    IOobject::NO_READ, 
                    IOobject::AUTO_WRITE 
                ), 
                mesh, 
                dimensionedScalar("sourceTerm", dimensionSet(0, 0, 0, 0, 0, 0, 0), -1)   );
			 
            tmp<fvScalarMatrix> tTempZEqn
            tTempZEqn = 
            (
                fvm::laplacian(Z) + sourceTerm
            );

            fvScalarMatrix& tempZEqn = tTempZEqn.ref();
            tempZEqn.relax();
            tempZEqn.solve();

            ...
            ...

            vectorField& field = *this
            forAll(Cf, i)
            {
                //After computing the normal vector, for each cell of the patch I should multiply Umax by the result of the Poisson problem, and then multiply by the normal vector. Lastly, I assign the result to field[i]
            }
        #}

        ...
        ...
}
Unfortunately, no errors are thrown and it does not seem to have any effect on the field Z looking at it in ParaView.



Alternative Approach:
Another idea I had was to preprocess the mesh using Python before running foamRun. I would solve the Poisson problem numerically for each inlet patch and store the results in external files. Later, I would read these files in the 0/U directory for each inlet, similar to how I retrieve the value of Umax depending on the time. However, I'm unsure how to store these results and retrieve them while looping through the patch cells, as I'm struggling to understand the indexing.


I hope my explanation was clear. I'm looking for advice on how to proceed or any alternative solutions that might be more suitable for this case. If more details are needed, I am happy to provide them.

Thank you for your help!

Best regards.
Ghukka is offline   Reply With Quote

Reply

Tags
parabolic inlet, parabolic profile, parabolic velocity, poisson equation, pseudo-parabolic


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
Import .csv - velocity profile - error eSKa CFX 9 April 3, 2021 14:38
Transient parabolic 3D velocity profile mattialupo Fluent UDF and Scheme Programming 1 October 15, 2019 08:35
Inlet velocity profile question dmirel STAR-CCM+ 4 October 8, 2019 05:42
Create hemisphere like velocity profile at inlet Nelson Main CFD Forum 3 July 27, 2005 13:05
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 10:11


All times are GMT -4. The time now is 02:44.