|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Daniel
Join Date: Feb 2024
Location: Austria
Posts: 7
Rep Power: 3 ![]() |
Hello,
i am doing research on the pressure drop due to rapid diameter expansion of pipes for small Reynoldsnumbers (laminar flow). My geometry/mesh can be seen in the attachments. First i tried a structured Mesh with cyclic boundary conditions. The segment itself is 45°. I did this to save computation time bc its an Axisymmetric flow type. But something strange happens. The Line which is also the symmetry axis seems to do strange things. I looked up a few tutorials and there they defined the centerline curve as physical curve in Blockmesh-then its set to empty in the constant/polyMesh/boundary file. I tried to do the same in GMSH but after gsmhToFoam import there is no Axis entry. Nevertheless i came across another Model- Axisymmetric flow wiht wegde boundary condition for the sides. This works perfectly fine for my case. I did follow these instructions : https://openfoamwiki.net/index.php/M...s/AxiSymmetric BUT - i wanted to check if the results match up with a real 3D simulation with a unstructured mesh. The velocity for in and outlet are nearly equal. But the inletPressure is in the 3D case a lot higher then in the axisymmetric case with the wedge bc. I am wondering what am i doing wrong. 1.: why is the case with the cyclic bc not working properly 2.: why is there a huge difference between the inletPressure (3D compared to axisymmetric with wedge bc) 3.: i implemented the fully developed inlet condition using codedFixedValue bc i need a parabolic inlet velocityprofile. I think its working fine but there is a little difference in the gradient near the wall- i will include a picture. So is the velocityprofile implemented correct. here are my used boundary conditions p/U for the cyclic case: Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2312 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type zeroGradient; value uniform 0; } outlet { type fixedMean; meanValue 0; value uniform 0; } wall { type zeroGradient; } "(cyclic_0|cyclic_1)" { type cyclic; } } // ************************************************************************* // Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2312 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { inlet { type codedFixedValue; value uniform (0 0 0); name inletLaminarProfil; code #{ const fvPatch& boundaryPatch = patch(); //generic const vectorField& Cf = boundaryPatch.Cf(); //generic vectorField& field = *this; //generic const scalar yc = 0; // definition of the center y coordinate const scalar rpipe = 0.00025; // definition of the pipe radius const scalar Umax = 0.596; // definition of the maximum velocity Re=10 forAll(Cf, faceI) // loop over all the patch faces { // const scalar x = Cf[faceI].x(); // x coordinate of the faces i const scalar y = Cf[faceI].y(); // y coordinate of the faces i const scalar z = Cf[faceI].z(); // z coordinate of the faces i const scalar radius = pow((y-yc)*(y-yc)+z*z,0.5); // compute radius from center patch field[faceI] = vector( Umax *(1-pow(radius/rpipe,2)), 0, 0); // define velocity value on the face i } #}; } outlet { type zeroGradient; } wall { type noSlip; } "(cyclic_0|cyclic_1)" { type cyclic; } } Code:
FoamFile { version 2.0; format ascii; class dictionary; object createPatchDict; } // This application/dictionary controls: // - optional: create new patches from boundary faces (either given as // a set of patches or as a faceSet) // - always: order faces on coupled patches such that they are opposite. This // is done for all coupled faces, not just for any patches created. // - optional: synchronise points on coupled patches. // 1. Create cyclic: // - specify where the faces should come from // - specify the type of cyclic. If a rotational specify the rotationAxis // and centre to make matching easier // - always create both halves in one invocation with correct 'neighbourPatch' // setting. // - optionally pointSync true to guarantee points to line up. // 2. Correct incorrect cyclic: // This will usually fail upon loading: // "face 0 area does not match neighbour 2 by 0.0100005%" // " -- possible face ordering problem." // - in polyMesh/boundary file: // - loosen matchTolerance of all cyclics to get case to load // - or change patch type from 'cyclic' to 'patch' // and regenerate cyclic as above // Do a synchronisation of coupled points after creation of any patches. // Note: this does not work with points that are on multiple coupled patches // with transformations (i.e. cyclics). pointSync false; // Patches to create. patches ( { // Name of new patch name cyclic_0; // Dictionary to construct new patch from patchInfo { type cyclic; neighbourPatch cyclic_1; // Optional: explicitly set transformation tensor. // Used when matching and synchronising points. transform rotational; rotationAxis (1 0 0); rotationCentre (0 0 0); rotationAngle 22.5; // transform translational; // separationVector (1 0 0); // Optional non-default tolerance to be able to define cyclics // on bad meshes matchTolerance 1E-4; } // How to construct: either from 'patches' or 'set' constructFrom patches; // If constructFrom = patches : names of patches. Wildcards allowed. patches (front); } { // Name of new patch name cyclic_1; // Dictionary to construct new patch from patchInfo { type cyclic; neighbourPatch cyclic_0; // Optional: explicitly set transformation tensor. // Used when matching and synchronising points. transform rotational; rotationAxis (1 0 0); rotationCentre (0 0 0); rotationAngle -22.5; // transform translational; // separationVector (1 0 0); // Optional non-default tolerance to be able to define cyclics // on bad meshes matchTolerance 1E-4; } // How to construct: either from 'patches' or 'set' constructFrom patches; // If constructFrom = patches : names of patches. Wildcards allowed. patches (back); } ); Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2312 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { /* inlet { type fixedValue; value uniform (1 0 0); } */ inlet { type codedFixedValue; value uniform (0 0 0); name inletLaminarProfil; code #{ const fvPatch& boundaryPatch = patch(); //generic const vectorField& Cf = boundaryPatch.Cf(); //generic vectorField& field = *this; //generic const scalar yc = 0; // definition of the center y coordinate const scalar rpipe = 0.00025; // definition of the pipe radius const scalar Umax = 0.596; // definition of the maximum velocity Re=1 forAll(Cf, faceI) // loop over all the patch faces { // const scalar x = Cf[faceI].x(); // x coordinate of the faces i const scalar y = Cf[faceI].y(); // y coordinate of the faces i const scalar z = Cf[faceI].z(); // z coordinate of the faces i const scalar radius = pow((y-yc)*(y-yc)+z*z,0.5); // compute radius from center patch field[faceI] = vector( Umax *(1-pow(radius/rpipe,2)), 0, 0); // define velocity value on the face i } #}; } outlet { type zeroGradient; } wall { type noSlip; } "(front|back)" { type wedge; } } // ************************************************************************* // Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2312 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type zeroGradient; value uniform 0; } outlet { type fixedMean; meanValue 0; value uniform 0; } wall { type zeroGradient; } "(front|back)" { type wedge; } } // ************************************************************************* // Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2312 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { /* inlet { type fixedValue; value uniform (1 0 0); } */ inlet { type codedFixedValue; value uniform (0 0 0); name inletLaminarProfil; code #{ const fvPatch& boundaryPatch = patch(); //generic const vectorField& Cf = boundaryPatch.Cf(); //generic vectorField& field = *this; //generic const scalar yc = 0; // definition of the center y coordinate const scalar rpipe = 0.00025; // definition of the pipe radius const scalar Umax = 0.596; // definition of the maximum velocity Re=1 forAll(Cf, faceI) // loop over all the patch faces { // const scalar x = Cf[faceI].x(); // x coordinate of the faces i const scalar y = Cf[faceI].y(); // y coordinate of the faces i const scalar z = Cf[faceI].z(); // z coordinate of the faces i const scalar radius = pow((y-yc)*(y-yc)+z*z,0.5); // compute radius from center patch field[faceI] = vector( Umax *(1-pow(radius/rpipe,2)), 0, 0); // define velocity value on the face i } #}; } outlet { type zeroGradient; } wall { type noSlip; } "(front|back)" { type wedge; } } // ************************************************************************* // Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2312 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type zeroGradient; value uniform 0; } outlet { type fixedMean; meanValue 0; value uniform 0; } wall { type zeroGradient; } "(front|back)" { type wedge; } } // ************************************************************************* // Did i do something wrong with the implementation of U? or did i set my bc completely wrong? Hope someone could help me out. I cant explain myself why there is a huge difference in inlet pressure... even though the velocities match perfect for 3D and wedge case |
|
![]() |
![]() |
![]() |
Tags |
codedfixedvalue, cyclic boundary condition, laminar flow, laminar flow in pipe, wedge mesh axisymmetric |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Does recirculation zone present in laminar flow? | swindlers | Main CFD Forum | 1 | May 11, 2024 13:53 |
CFX Treatment of Laminar and Turbulent Flows | Jade M | CFX | 18 | September 15, 2022 07:08 |
High velocity in Laminar flow | Manojmech | FLUENT | 0 | November 3, 2016 04:37 |
Is it a turbulent flow or laminar flow? | ringtail | Main CFD Forum | 9 | January 22, 2015 19:52 |
Test for a laminar flow in axisymmetric nozzle | Victor | Main CFD Forum | 0 | November 30, 2005 10:51 |