CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Cyclic 'U' and Non-cyclic 'Scalar' on cyclic boundary (https://www.cfd-online.com/Forums/openfoam/237664-cyclic-u-non-cyclic-scalar-cyclic-boundary.html)

hhu_lulu July 29, 2021 05:28

Cyclic 'U' and Non-cyclic 'Scalar' on cyclic boundary
 
Dear FOAMers:
I am using OpenFOAM 7.0 to simulate the scalar transport in curved open channel, with interFoam and smagorinsky LES model.
In order to get the fully developed flow field, I impose cyclic BC for U and p_rgh at INLET and OUTLET. For the variable scalar, I impose Dirichlet BC at INLET and Neumann BC at OUTLET. It turns out not working. OpenFOAM requires the same cyclic BC for scalar. BTW, the scalar is released in the form of point source near the INLET.
How could I realize the above request?:D Any ideas are appreciated.
Thanks in advance!

Here I post my boundary file, U file and scalar file:
Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      polyBoundaryMesh;
    location    "constant/polyMesh";
    object      boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

4
(
    INLET
    {
        type            cyclic;
        inGroups        1(cyclic);
        nFaces          3600;
        startFace      10239600;
        matchTolerance  0.0001;
        transform      unknown;
        neighbourPatch  OUTLET;
    }
    OUTLET
    {
        type            cyclic;
        inGroups        1(cyclic);
        nFaces          3600;
        startFace      10243200;
        matchTolerance  0.0001;
        transform      unknown;
        neighbourPatch  INLET;
    }
    WALLS
    {
        type            wall;
        inGroups        1(wall);
        nFaces          163200;
        startFace      10246800;
    }
    ATMOSPHERE
    {
        type            patch;
        nFaces          86400;
        startFace      10410000;
    }
)

Code:

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            cyclic;
    }

    OUTLET
    {
        type            cyclic;
    }
       
    WALLS
    {
        type            noSlip;
    }

    ATMOSPHERE
    {
        type            pressureInletOutletVelocity;
        value          uniform (0 0 0);
    }
}

Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    object      scalar1;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];

internalField  uniform 0;

boundaryField
{
    INLET
    {
        type            fixedValue;
        value          uniform 0;
    }

    OUTLET
    {
        type            zeroGradient;
    }

    WALLS
    {
        type            zeroGradient;
    }

    ATMOSPHERE
    {
        type            inletOutlet;
        inletValue      uniform 0;
        value          uniform 0;
    }
}


piu58 July 29, 2021 06:14

May be you can use the following appoach:

Calculate the flux (U and p) with your periodic b.c. but without the scaler. Uses scalaTransportFoam afterwards. You cannot get a transient result for the scalar, however.

hhu_lulu July 29, 2021 08:17

Hi, Pilz, thanks for your reply!
Your idea sounds reasonable, I gonna adopt the advice and apply it in my simulation.
However, I am still wondering there are any simpler ways for cyclic cases.

piu58 July 29, 2021 12:07

It is always valuable de-coupling effects in a simulation. This way, scalarTransportFoam is easier not more complicated. And the results are more reliable in comparison ton al-in-all simulation.

Cyclic b.c. often arise problems and lead to nonphysical results. It may be you have to look for another approach anyway.

kerim July 5, 2022 23:06

Cyclic 'U' and Non-cyclic 'Scalar' on cyclic boundary
 
Dear hhu lulu,
Were you able to solve your problem? I faced the same problem when I tried to simulate 2D periodic hills with passive scalar transport. Using scalarTransportFoam solver, as mentioned by piuy58, seems more perspective.

agustinvo July 29, 2022 12:23

Have you tried to add a heat sink using fvOptions/fvModels? In the paste several channel flows with similar scalar conditions were performed.

kerim July 31, 2022 00:51

Quote:

Originally Posted by agustinvo (Post 832675)
Have you tried to add a heat sink using fvOptions/fvModels? In the paste several channel flows with similar scalar conditions were performed.

Would you like to give a link to above mentioned channel flows?

agustinvo August 3, 2022 00:23

Quote:

Originally Posted by kerim (Post 832750)
Would you like to give a link to above mentioned channel flows?




I have been searching but I only found constant wall heat flux, I thought I saw something for fixed scalar value.


I have some ideas to deal with this problem

  • Compute the wall scalar flux so you get the amount of energy that comes in. Once you have it you can add a sink term in your scalar equation to decrease the scalar value in your domain. However the scalar profile is returned to the inlet.
  • There are some BC's called jumpCyclic and fixedJump that migth be interesting for you, however they apply an ofset isntead of reducing to a certain value your returned field. You can investigate these conditions and create a modified one for your purposes.
  • Going in the same direction, using mapped BC's for U you can move from cyclic to patch boundaries and you could use your actual BC's for the scalar.
I saw that your scalar BC's only have 0 values and zeroGradients. Unless you add a source of a BC with larger values you will see no changes.


Regards

hhu_lulu August 15, 2022 11:40

Quote:

Originally Posted by kerim (Post 831052)
Dear hhu lulu,
Were you able to solve your problem? I faced the same problem when I tried to simulate 2D periodic hills with passive scalar transport. Using scalarTransportFoam solver, as mentioned by piuy58, seems more perspective.

Hi, Kerim:
Sorry for my slow reply.
I find a workaround with my issue. The periodic B.C. has still been used for the scalar in my case. To prevent the scalar from recycling, the scalarFixedValueConstraint has been used to set the value of scalar to 0 at the end of the computational domain. That is, the scalar is released from the source and it vanishes near the outlet, which would not influence the scalar transport in a single period.
I don't know whether this method matches your problem. Maybe you can elaborate on your cases. Thanks!


All times are GMT -4. The time now is 13:26.