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/)
-   -   mappedPatch with channel flow (https://www.cfd-online.com/Forums/openfoam-solving/130167-mappedpatch-channel-flow.html)

ArathoN February 20, 2014 14:44

mappedPatch with channel flow
 
I want to simulate the fully developed flow in a rectangular channel and i decided to use the mappedpatch option with the solver simpleFoam.

I mapped the inlet with the outlet and I put as value variable the velocity i want like this:
Code:

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

internalField  uniform (0 0 0);

boundaryField
{
    inlet
    {
        type                  mapped;
        value                uniform (9.07 0 0);
        interpolationScheme  cell;
        setAverage            false;
        average              (9.07 0 0); 
    }

    outlet
    {
        type            zeroGradient;
    }

    upperWall
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }

    lowerWall
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }

    frontAndBack
    {
        type            empty;
    }
}


What i want is that the maximum velocity would be the given one, so it must be the center-line velocity. But after the simulation the velocity would increase and i can't figure out how i can make it stop doing it.

My hypothesis is that with mappedpatch it will try to maintain constant the massflow so the velocity at centerline represent the maximum flow and having the boundary layer the velocity will have to increase at the center-line cause near wall it's null. How can i counter this? I have the experimental data in 12 point of the channel height, can they be useful?

Here the interested part of blockmeshDict:

Code:

inlet
    {
        type mappedPatch;
        offset          ( 0.4 0 0 );
        sampleRegion    region0;
        sampleMode      nearestCell;
        samplePatch    none;
        faces
        (
            (0 5 11 6)
            (5 4 10 11)
        );
    }
    outlet
    {
        type patch;
        faces
        (

            (1 2 8 7)
            (2 3 9 8)         
        );


ArathoN February 21, 2014 10:13

Resolved.

The values given at the boundary for the velocity for openFoam isn't the center-line velocity (as i wanted) but the bulk velocity.

knowing the definition of the bulk velocity ( Ub=1/h * integral[ U(y) dy] ) and having the experimental data i'll try to compute it with the trapezoidal method using excel. I'll report my results if i'm succesfull.

huangxianbei March 17, 2014 06:23

Quote:

Originally Posted by ArathoN (Post 476045)
Resolved.

The values given at the boundary for the velocity for openFoam isn't the center-line velocity (as i wanted) but the bulk velocity.

knowing the definition of the bulk velocity ( Ub=1/h * integral[ U(y) dy] ) and having the experimental data i'll try to compute it with the trapezoidal method using excel. I'll report my results if i'm succesfull.

How long did you take to get a fully developed flow? I monitored the velocity at y+=30,the velocity shows really huge fluctuation and the period of it is almost 150 flow-through time. By the way ,I used the channelFoam

ArathoN May 5, 2014 04:06

Sorry if i didn't reply earlier, I simulated again the case with mappedPatch option and the simulation will converge even though the residual will oscillate around a really low value. The velocity profile is quite similar to the profile given thanks to the experimental data, except obviously for the region near the wall. Now i'll try to validate it comparing the u+-y+ graphs with the experimental data.

Btw Did you try pimplefoam + cyclic? I can't get proper results cause of high pressure residual.

huangxianbei May 5, 2014 04:11

Quote:

Originally Posted by ArathoN (Post 489821)
Sorry if i didn't reply earlier, I simulated again the case with mappedPatch option and the simulation will converge even though the residual will oscillate around a really low value. The velocity profile is quite similar to the profile given thanks to the experimental data, except obviously for the region near the wall. Now i'll try to validate it comparing the u+-y+ graphs with the experimental data.

Btw Did you try pimplefoam + cyclic? I can't get proper results cause of high pressure residual.

Thank you. I think the initial data in the tutorial is from perhaps LES. I find that the time takes to reach a fully turbulent flow is long when using perturbU, however, I haven't found a faster way to specify the initial condition.

ArathoN May 5, 2014 05:06

I'm validating the Backward facing step and right now i'm studying the channel because i need a fully developed turbulent flow (i work with Re=15000 to 64000) so I've took the experimental data (from backward step) and I calculated all the initial data like k and turbulence intensity.

However until now I've used the RAS models, especially I've used the simpleFoam solver with mappedpatch condition or the usual setting with the developing region (i noticed that in High-Re channel the needed length for the channel to develop the flow is quite short aroud 25 High step with Re=15000).

I'll try again the cyclic BCs with simpleFoam (on OF 2.2 it didn't work, a patch was needed) and maybe I'll touch the LES settings (never done such a simulation).

My main problem right now is make the pimplefoam solver work on OF 2.3, in the previous version it worked wonderfully, here the LINK of the thread with my problem. I'll greatly appreciate any help.

Now i have a doubt why you need the perturbU if you can specify initial data based on experimental data? and what does this utility do?

P.S. Did you ever used the Kim data? I'm having a problem with the computed u_tau, the value calculated from the Re_tau and from y/yplus are different.

huangxianbei May 5, 2014 09:11

Quote:

Originally Posted by ArathoN (Post 489836)
I'm validating the Backward facing step and right now i'm studying the channel because i need a fully developed turbulent flow (i work with Re=15000 to 64000) so I've took the experimental data (from backward step) and I calculated all the initial data like k and turbulence intensity.

However until now I've used the RAS models, especially I've used the simpleFoam solver with mappedpatch condition or the usual setting with the developing region (i noticed that in High-Re channel the needed length for the channel to develop the flow is quite short aroud 25 High step with Re=15000).

I'll try again the cyclic BCs with simpleFoam (on OF 2.2 it didn't work, a patch was needed) and maybe I'll touch the LES settings (never done such a simulation).

My main problem right now is make the pimplefoam solver work on OF 2.3, in the previous version it worked wonderfully, here the LINK of the thread with my problem. I'll greatly appreciate any help.

Now i have a doubt why you need the perturbU if you can specify initial data based on experimental data? and what does this utility do?

P.S. Did you ever used the Kim data? I'm having a problem with the computed u_tau, the value calculated from the Re_tau and from y/yplus are different.

Because I don't have experimental data. So a reasonable initial field is needed, if not, the time to be turbulent will be much longer.
Yes, I use the Kim data for comparison. What do you mean that the value calculated from the Re_tau and from y/yplus are different?

ArathoN May 5, 2014 09:26

I tried to calculate utau both from the given reynolds & nu, and from yplus and y; but i had different values of utau then i noticed that the y data was normalized by the channel width.

Can you link me the perturb thread you used? is it usefull only with LES or can i use it with RANS?

I'll try to run some LES simulations and i Hope to resolve my issues with the Cyclic condition on pimplefoam. I'll write here any results i'll have.

huangxianbei May 5, 2014 09:32

Quote:

Originally Posted by ArathoN (Post 489909)
I tried to calculate utau both from the given reynolds & nu, and from yplus and y; but i had different values of utau then i noticed that the y data was normalized by the channel width.

Can you link me the perturb thread you used? is it usefull only with LES or can i use it with RANS?

I'll try to run some LES simulations and i Hope to resolve my issues with the Cyclic condition on pimplefoam. I'll write here any results i'll have.

You can find it http://www.cfd-online.com/Forums/ope...tml#post187632
It's a utility which can generate a initial field for channel flow.
If the channel is not rotate, then the ut at both sides should be equal.
y is normalized by half-width

ArathoN May 5, 2014 11:40

mmm in the ReadMe of the channel data zip it was written that the normalization was done with respect to "h", and i supposed it was the channel height.

I'm having a huge doubt, how do you decide the sizing of the grid? I know than the yplus needs to be lower than 1 to better determine the viscous layer and hence teh friction coefficient. But i found almost no information on the other two direction (spanwise and streamwise).

huangxianbei May 5, 2014 20:57

Quote:

Originally Posted by ArathoN (Post 489931)
mmm in the ReadMe of the channel data zip it was written that the normalization was done with respect to "h", and i supposed it was the channel height.

I'm having a huge doubt, how do you decide the sizing of the grid? I know than the yplus needs to be lower than 1 to better determine the viscous layer and hence teh friction coefficient. But i found almost no information on the other two direction (spanwise and streamwise).

Usually,it's half-height.You should clarify this.
If the streamwise and spanwise is long comparing with y direction,than a finer mesh is required, say 128 grids in x and z.
You can first do a LES simulation. In RANS, the wall function is used which take a different method in sublayer and log-law region(y+=30)
So the region between sublayer and log-law layer is removed in this way.

ArathoN May 6, 2014 04:35

The data i've used are from this site, and in the file for mean profiles you'll see he uses "h" for the normalizations.

For the grid size I know about the grid requirement in the normal direction (Low-Re vs High-Re Meshes) and when to use the relative wall-Functions, but i couldn't find any info about the grid requirement in the other two directions.

In fact I'm going to do a refinement check, starting with a coarse uniform mesh and i'll see the mesh density needed to have a solution independent from the grid sizing. From this I think i can provide a better insight on how to consider a graded mesh in the boundary layer (especially in the sublayer where i can specify the first rid point and the optimal grid points needed to better define the region). Then I'll see the requirement for the other 2 directions.

I'm amazed that no one has done a study about the grid sizing for such simple cases, in every report I've read about channels they only specify their grid point without defining the grading coefficients which I think It's the most important info.

P.S. if you want i found the experimental data for the channel with higher Re (from 15000 onward).

huangxianbei May 7, 2014 02:40

Quote:

Originally Posted by ArathoN (Post 490058)
The data i've used are from this site, and in the file for mean profiles you'll see he uses "h" for the normalizations.

For the grid size I know about the grid requirement in the normal direction (Low-Re vs High-Re Meshes) and when to use the relative wall-Functions, but i couldn't find any info about the grid requirement in the other two directions.

In fact I'm going to do a refinement check, starting with a coarse uniform mesh and i'll see the mesh density needed to have a solution independent from the grid sizing. From this I think i can provide a better insight on how to consider a graded mesh in the boundary layer (especially in the sublayer where i can specify the first rid point and the optimal grid points needed to better define the region). Then I'll see the requirement for the other 2 directions.

I'm amazed that no one has done a study about the grid sizing for such simple cases, in every report I've read about channels they only specify their grid point without defining the grading coefficients which I think It's the most important info.

P.S. if you want i found the experimental data for the channel with higher Re (from 15000 onward).

Yes, I didn't found any report about the grid size. I suggest you to use a finer mesh at the beginning, I have tested that if the x direction is long, the grid needed in this direction should be 128 or more, while in the normal direction, 64 should be enough.
I'll appreciate if you can show me the experimental data.

ArathoN May 7, 2014 07:16

Here a gook link with lots of datasets.

Did you use a uniform mesh along x and z direction like the tutorial channel395? and what yplus do you have? And how did you choose the dimensions on the three directions, I know there is a paper by Dean where he gives some insight ("REYNOLDS-NUMBER DEPENDENCE OF SKIN FRICTION AND OTHER BULK FLOW VARIABLES IN 2-DIMENSIONAL RECTANGULAR DUCT FLOW") but unfortunately i couldn't find the paper "free" (if someone has it please pm it to me).

My channel has these dimentions 1x0.025x0.1m (40*HxHx4*H), knowing that in the Kim paper the channel dimensions were 7mx22cmx85cm (32*HxHx4*H). Now i'll try the simulation with different yplus then i'll change the grid spacing along x and z respectively. I hope i'll finish all the needed simulation for 9/05 and i'll report back. Did it take a lot of time to converge with LES?

If you have some interesting paper about channel or backward facing step I would greatly appreciate if you could send it to me. Another paper i couldn't fin was this "THEORETICAL AND EXPERIMENTAL INVESTIGATION OF FLOW OVER SINGLE AND DOUBLE BACKWARD FACING STEPS" by Abbott.

PS Last question I'm choosing a Co number 0.5 for better stability did you define the time step based on the smallest grid spacing?

huangxianbei May 7, 2014 07:32

Quote:

Originally Posted by ArathoN (Post 490341)
Here a gook link with lots of datasets.

Did you use a uniform mesh along x and z direction like the tutorial channel395? and what yplus do you have? And how did you choose the dimensions on the three directions, I know there is a paper by Dean where he gives some insight ("REYNOLDS-NUMBER DEPENDENCE OF SKIN FRICTION AND OTHER BULK FLOW VARIABLES IN 2-DIMENSIONAL RECTANGULAR DUCT FLOW") but unfortunately i couldn't find the paper "free" (if someone has it please pm it to me).

My channel has these dimentions 1x0.025x0.1m (40*HxHx4*H), knowing that in the Kim paper the channel dimensions were 7mx22cmx85cm (32*HxHx4*H). Now i'll try the simulation with different yplus then i'll change the grid spacing along x and z respectively. I hope i'll finish all the needed simulation for 9/05 and i'll report back. Did it take a lot of time to converge with LES?

If you have some interesting paper about channel or backward facing step I would greatly appreciate if you could send it to me. Another paper i couldn't fin was this "THEORETICAL AND EXPERIMENTAL INVESTIGATION OF FLOW OVER SINGLE AND DOUBLE BACKWARD FACING STEPS" by Abbott.

PS Last question I'm choosing a Co number 0.5 for better stability did you define the time step based on the smallest grid spacing?

Thank you very much. The dimension is 4pi*hx2hx2pi*h.
The y plus is about 0.5.
I haven't investigate the backward facing step, so I'm sorry there is no paper about this in my hand.
Co<1 is required if PISO is used. The Comax is about 0.6 in the simulation.

Z.Q. Niu May 8, 2014 04:35

Hello, xianbei,
Would you mind telling me how to calculate u+ and y+ of channel flow in Open Foam?
Thank you !

huangxianbei May 8, 2014 04:54

Quote:

Originally Posted by Z.Q. Niu (Post 490572)
Hello, xianbei,
Would you mind telling me how to calculate u+ and y+ of channel flow in Open Foam?
Thank you !

u+ is u/ut, ut is the friction velocity
y+ is calculated as y+=y*ut/mu, mu is the viscosity

ArathoN May 8, 2014 13:20

Quote:

Originally Posted by huangxianbei (Post 490574)
u+ is u/ut, ut is the friction velocity
y+ is calculated as y+=y*ut/mu, mu is the viscosity

mu? It should be ni the cinematic viscosity.

Btw you'll have to output yPlus then knowing y and ni you calculate ut and from it u. This is the fastest way otherwise you can output the wallshearstress and if you are working in incompressible field the values are normalized by the density so you have tau_wall/rho=ut^2.

The only problem here is the yplus, if you search the forum you'll see that if you use a wall resolved method other than les the yplus utility (yPlusRAS) will give different values from the real yplus (because yPlusRAS is based on the turbulent kinetic energy and it's the yStar from fluent) so in this case you need to patch it.

You'll notice that the fully developed region is given by a constant value of ut (tau_wall) and you need the values over the y-direction to map u+ vs y+.

PS: @huangxianbei what grading did you use for the direction y,x,z?

EDIT: I tried to simulate the case with cyclic BCs and I can't complete the simulation, It always crashes even if I use LES or RAS models. If someone is willing to help (Please) i can post all my files.

huangxianbei May 8, 2014 20:24

Quote:

Originally Posted by ArathoN (Post 490681)
mu? It should be ni the cinematic viscosity.

Btw you'll have to output yPlus then knowing y and ni you calculate ut and from it u. This is the fastest way otherwise you can output the wallshearstress and if you are working in incompressible field the values are normalized by the density so you have tau_wall/rho=ut^2.

The only problem here is the yplus, if you search the forum you'll see that if you use a wall resolved method other than les the yplus utility (yPlusRAS) will give different values from the real yplus (because yPlusRAS is based on the turbulent kinetic energy and it's the yStar from fluent) so in this case you need to patch it.

You'll notice that the fully developed region is given by a constant value of ut (tau_wall) and you need the values over the y-direction to map u+ vs y+.

PS: @huangxianbei what grading did you use for the direction y,x,z?

EDIT: I tried to simulate the case with cyclic BCs and I can't complete the simulation, It always crashes even if I use LES or RAS models. If someone is willing to help (Please) i can post all my files.

You mean the yPlusLES gives the right yplus and yPlusRAS gives a resolved yplus?I haven't used the RAS yet, so I'm just curious about this.

The only non-uniform direction is y, ie. 10. The homogenous directions use the uniform mesh.

Z.Q. Niu May 8, 2014 22:26

Dear Xianbei,
I have not found the utility for plotting yplus with solver of DNS, have you got it ?


All times are GMT -4. The time now is 23:20.