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

mappedPatch with channel flow

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 9, 2014, 12:07
Default
  #21
Senior Member
 
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 13
huangxianbei is on a distinguished road
Quote:
Originally Posted by Z.Q. Niu View Post
Dear Xianbei,
I have not found the utility for plotting yplus with solver of DNS, have you got it ?
you should use the method ArathoN suggested
huangxianbei is offline   Reply With Quote

Old   May 9, 2014, 12:53
Default
  #22
Senior Member
 
ArathoN
Join Date: Jul 2011
Posts: 137
Rep Power: 15
ArathoN is on a distinguished road
Quote:
Originally Posted by huangxianbei View Post
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.
From what i gathered around this forum I learned:

1- the yPlusRAS works only if you use wall function for nut, in fact there is a nutLowReWallFunction valid only for yPlus>1 (it's more a placeholder function that nullify the turbulent viscosity at the wall) and if you want to work with yPlus less the unit you need or to patch the yPlus utility or use a model like kOmegaSST defining nut with nutUSpaldingWallFunction (It gives good results).

2- the yPlusRAS is related to the turbulent kinetic energy and not to the usual friction velocity. It's defined ad the yStar present on Fluent.

3- the yPlusRAS utility should give the exact values of y+ (yStar=yPlus) if the first cell is in the log layer. But this is not so clear and i didn't test this one.

Here the thread with the patch for yPlus.
ArathoN is offline   Reply With Quote

Old   May 9, 2014, 12:57
Default
  #23
Senior Member
 
ArathoN
Join Date: Jul 2011
Posts: 137
Rep Power: 15
ArathoN is on a distinguished road
Quote:
Originally Posted by Z.Q. Niu View Post
Hello, xianbei,
Would you mind telling me how to calculate u+ and y+ of channel flow in Open Foam?
Thank you !
There is no default utility to calculate and plot u+ and y+, so you need to follow what i wrote earlier.

There is a solver "BoundaryFoam" that can compute directly the y+ and u+ but from what i understood it is a 1-D solver, more oriented to teh analysis of a flat plate or a side of the channel (under the assumption that the height is enough to make the blockage effects negligible). If you find more info about this one please share.
ArathoN is offline   Reply With Quote

Old   May 9, 2014, 22:09
Default
  #24
Senior Member
 
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 13
huangxianbei is on a distinguished road
Quote:
Originally Posted by ArathoN View Post
From what i gathered around this forum I learned:

1- the yPlusRAS works only if you use wall function for nut, in fact there is a nutLowReWallFunction valid only for yPlus>1 (it's more a placeholder function that nullify the turbulent viscosity at the wall) and if you want to work with yPlus less the unit you need or to patch the yPlus utility or use a model like kOmegaSST defining nut with nutUSpaldingWallFunction (It gives good results).

2- the yPlusRAS is related to the turbulent kinetic energy and not to the usual friction velocity. It's defined ad the yStar present on Fluent.

3- the yPlusRAS utility should give the exact values of y+ (yStar=yPlus) if the first cell is in the log layer. But this is not so clear and i didn't test this one.

Here the thread with the patch for yPlus.
Thank you for the details. I'm going to do a LES calculation the next week, hoping we can both get good results
huangxianbei is offline   Reply With Quote

Old   May 10, 2014, 04:51
Default
  #25
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
hi,

I wanna map the velocity field at z=0.04 to z=0 plane. I use the following in blockMeshDict:

Code:
    inlet
    {
        type mappedPatch;
        offset          ( 0.04 0 0 );
        sampleRegion    region0;
        sampleMode      nearestCell;
        samplePatch     none;
        faces
        (
            (0 3 2 1)
            (1 2 9 8)
        );
    }
and in 0/U:
Code:
    inlet           
    {
        type            mapped;
        value           uniform (0 0 20);
        interpolationScheme cell;
        setAverage      true;
        average         (0 0 20);
    }
I'm using OF-2.1.0 and pisoFoam with LES turbulence model to simulate flow in a square channel.

when I ran it the following error appeared:

Code:
--> FOAM FATAL ERROR: 
Did not find sample (0.501437 0.00902886 0) on any processor of region region0

    From function mappedPatchBase::findSamples(const pointField&, labelList&, labelList&, pointField&)
    in file mappedPatches/mappedPolyPatch/mappedPatchBase.C at line 368.

FOAM exiting
my question is where is the region0? and the point (0.501437 0.00902886 0) that is mentioned in error is not in my domain, the length of domain in x-direction is 0.5!!!!

I ran successfully my case using

Code:
	sampleMode      nearestPatchFace;
in blockMeshDict which the nearest patch face is the outlet on the channel, but I want to map the z=0.04 to z=0, instead.

anybody knows what should I do?
adambarfi is offline   Reply With Quote

Old   May 10, 2014, 09:14
Default
  #26
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
sorry, I was very tired and made a bad mistake, as I said I wanted to map z=0.04 to z=0, but I was mapping x=0.04 to x=0!!!!!
the problem is solved,

but another question: where is the region0 and what we define it? I removed it and my case ran without any error like before.

Regards,
Mostafa
adambarfi is offline   Reply With Quote

Old   May 11, 2014, 12:01
Default
  #27
Senior Member
 
ArathoN
Join Date: Jul 2011
Posts: 137
Rep Power: 15
ArathoN is on a distinguished road
Quote:
Originally Posted by adambarfi View Post
sorry, I was very tired and made a bad mistake, as I said I wanted to map z=0.04 to z=0, but I was mapping x=0.04 to x=0!!!!!
the problem is solved,

but another question: where is the region0 and what we define it? I removed it and my case ran without any error like before.

Regards,
Mostafa
ok glad you solved your problem. Region0 is only the name associated to fictitious region that can be defined and used in some function. E.g. you set the section on z=0.04 to the region0 and use it to map the patch at z=0.

It's strange that changing region0 name didn't give you errors, i remember trying it (i didn't know how mappedpatch worked and i thought that i had to set the patch name in sampleRegion) and it gave me tons of errors.
ArathoN is offline   Reply With Quote

Old   May 15, 2014, 06:24
Default
  #28
Senior Member
 
ArathoN
Join Date: Jul 2011
Posts: 137
Rep Power: 15
ArathoN is on a distinguished road
Quote:
Originally Posted by huangxianbei View Post
Thank you for the details. I'm going to do a LES calculation the next week, hoping we can both get good results
Did you get good results? I'm facing a problem with Cyclic BCs + pimplefoam, I have high residuals for Ux even thought the residuals of the other variable continue to decrease.

I don't know if it is a problem of how i defined the time step or of the mesh. I tried changing everything and even refining the mesh but I have the same behavior. From what i found in the forum Les simulation requires an uniform-like mesh and in my case i have a cell-to-cell expansion ratio of 1.07 (0.99); it should be ok as a ratio.

Can you share your blockMeshDict, this would really help me. And what did you set on Perturbation properties.


PS: for the Co number I've chosen the smallest grid space in the y direction (6e-4) and setting Co as 0.5 and U=Ubar i calculated my timestep which is really small around e-4. How do you compute it?
ArathoN is offline   Reply With Quote

Old   May 15, 2014, 10:56
Default
  #29
Senior Member
 
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 13
huangxianbei is on a distinguished road
Quote:
Originally Posted by ArathoN View Post
Did you get good results? I'm facing a problem with Cyclic BCs + pimplefoam, I have high residuals for Ux even thought the residuals of the other variable continue to decrease.

I don't know if it is a problem of how i defined the time step or of the mesh. I tried changing everything and even refining the mesh but I have the same behavior. From what i found in the forum Les simulation requires an uniform-like mesh and in my case i have a cell-to-cell expansion ratio of 1.07 (0.99); it should be ok as a ratio.

Can you share your blockMeshDict, this would really help me. And what did you set on Perturbation properties.


PS: for the Co number I've chosen the smallest grid space in the y direction (6e-4) and setting Co as 0.5 and U=Ubar i calculated my timestep which is really small around e-4. How do you compute it?
you need a more compact mesh near wall. The mesh in y direction is with a grad of 10, simplegrad.
The perturbUdict is not changed, just used by default except the Ret.
The residual is really high, about 0.01 in x direction. However, this will not affect the results.
Keep Co<0.5 is enough
huangxianbei is offline   Reply With Quote

Old   May 20, 2014, 11:37
Default
  #30
Senior Member
 
ArathoN
Join Date: Jul 2011
Posts: 137
Rep Power: 15
ArathoN is on a distinguished road
Here my setup, I started with a coarse mesh and i kept refining. Unfortunately I didn't get good results, the residual will begin to increase and then they will oscillate.

I changed almost everything but i couldn't get any results. The Retau=590 with Reb=10935.

Please someone help me, i'm out of ideas.
ArathoN is offline   Reply With Quote

Old   May 20, 2014, 12:02
Default
  #31
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
Quote:
Originally Posted by ArathoN View Post
Here my setup, I started with a coarse mesh and i kept refining. Unfortunately I didn't get good results, the residual will begin to increase and then they will oscillate.

I changed almost everything but i couldn't get any results. The Retau=590 with Reb=10935.

Please someone help me, i'm out of ideas.
I have the same problem!
adambarfi is offline   Reply With Quote

Old   May 20, 2014, 12:37
Default
  #32
Senior Member
 
ArathoN
Join Date: Jul 2011
Posts: 137
Rep Power: 15
ArathoN is on a distinguished road
Quote:
Originally Posted by adambarfi View Post
I have the same problem!
I'm beginning to doubt the Cyclic BCs, I'll try mappedPatch.

I can't figure out why the hell The residual s go that way. Hope someone could give us some info.

Last edited by ArathoN; May 20, 2014 at 13:46.
ArathoN is offline   Reply With Quote

Old   May 21, 2014, 01:30
Default
  #33
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
hi again,

I wanna know what is different between mapped bc with cyclic bc? I'm using openFoam-2.2.2
I ran 3 cases (Re_tau=395, Re_b=13750):

1- cyclic bc with the initial conditions which provided by pimpleFoam/channel395 using OF-222/pimpleFoam solver
2- cyclic bc with the initial conditions which provided by perturbU using OF-222/pimpleFoam solver
3- mapped bc for U and zero initial conditions using OF-210/pisoFoam solver

I attach the residuals and p probes plots for first case, they demonstrate that the flow is not stable, it's varying with time. at the beginning of this fluctuations in residuals I thought that it's because of the memory of turbulence flow, but after a long time it should be removed, but it did't happen.

when I'm using mapped boundary condition for U, the flow pattern seems more realistic than cyclic bc with the initial conditions which provided by pimpleFoam/channel395 case.
I tried perturbU and cyclic bc together and the results was as bad as before!

the only problem that I have with mapped bc is that I can't validate it with any paper.

anybody knows what and where is the problem? and how can I reach a proper solution?

Regards
Mostafa
Attached Images
File Type: png pProbes.png (66.4 KB, 41 views)
File Type: png Residuals.png (41.5 KB, 41 views)
adambarfi is offline   Reply With Quote

Old   May 21, 2014, 11:15
Default
  #34
Member
 
Niu
Join Date: Apr 2014
Posts: 55
Rep Power: 11
Z.Q. Niu is on a distinguished road
Dear Mostafa,
I has some confusion about mapped bc for U and zero initial conditions, if so, how is perturbations generated?

Best Regards!
Z.Q. Niu
Z.Q. Niu is offline   Reply With Quote

Old   May 21, 2014, 11:50
Default
  #35
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
Quote:
Originally Posted by Z.Q. Niu View Post
Dear Mostafa,
I has some confusion about mapped bc for U and zero initial conditions, if so, how is perturbations generated?

Best Regards!
Z.Q. Niu
dear Niu,

Actually I didn't any perturbation on it. I just let it a long time to solve and then the flow pattern was reasonable, but the velocities' magnitude wasn't correct.
Now, I'm running a case with cyclic bc and using perturbU for initial condition. I first ran it with a coarse grid and after 5000 time step I changed the mesh and used a smaller mesh and mapped the results to my new case, and it's now solving that. the residuals are reasonable but I'm in doubt for the flow pattern!!!!
when the solving completes, I'll share the results here.

Regards,
Mostafa
adambarfi is offline   Reply With Quote

Old   May 21, 2014, 13:49
Default
  #36
Member
 
Niu
Join Date: Apr 2014
Posts: 55
Rep Power: 11
Z.Q. Niu is on a distinguished road
Dear Mostafa,
In fact, I used mapped bc to simulate a channel flow several days ago, the inlet boundary is in the same patten as /tutorials/incompressible/pisoFoam/les/pitzDailyMapped, as followed:
inlet
{
type mapped;
value uniform (10 0 0);
interpolationScheme cell;
setAverage true;
average (10 0 0);
}
I found the maximum velocity of the whole region was increasing, but there were no sign of transition. I also chose pimpleFoam solver,In file of turbulenceProperties, the turbulenceModel is laminar. Is this the same with yours? How long have you run case? Would you mind sharing your mapped case with me? Thank you very much!

Best regards!

Z.Q. Niu
Z.Q. Niu is offline   Reply With Quote

Old   May 21, 2014, 14:13
Default
  #37
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
dear Niu,

Unfortunately, I deleted the results from my hard disk, but as the current solution is done, I'll try that bc again, and then I will share the results with you.

Also, in next weekend I'll go to the lab my supervisor recently ran it, and I will try these different boundary conditions with more quick computers.

Bests,
Mostafa
adambarfi is offline   Reply With Quote

Old   May 21, 2014, 15:25
Default
  #38
Member
 
Niu
Join Date: Apr 2014
Posts: 55
Rep Power: 11
Z.Q. Niu is on a distinguished road
Dear Mostafa,
Thank you! I will try it again! Hoping u can get good results!

Best regards!

Z.Q. Niu
Z.Q. Niu is offline   Reply With Quote

Old   May 22, 2014, 03:44
Default
  #39
Senior Member
 
ArathoN
Join Date: Jul 2011
Posts: 137
Rep Power: 15
ArathoN is on a distinguished road
Quote:
Originally Posted by adambarfi View Post
dear Niu,

Actually I didn't any perturbation on it. I just let it a long time to solve and then the flow pattern was reasonable, but the velocities' magnitude wasn't correct.
Now, I'm running a case with cyclic bc and using perturbU for initial condition. I first ran it with a coarse grid and after 5000 time step I changed the mesh and used a smaller mesh and mapped the results to my new case, and it's now solving that. the residuals are reasonable but I'm in doubt for the flow pattern!!!!
when the solving completes, I'll share the results here.

Regards,
Mostafa
I let it running until T=30 with a timestep of 2e-4 and the residuals keeps increasing after an interval where they deceased, the problem relies on the pressure and I don't know why. Did you had such behavior, because i don't know if i have to stop the simulation or to wait more and see how it develops.

What did you set in pRefCell and pRefValue? I've set it to 0, you?

Edit: in perturbU I only changed Retau and I don't know if it's better to set setBulk to true or leave it to false. What did you set? And did any of you change the perturbation properties?
ArathoN is offline   Reply With Quote

Old   May 22, 2014, 04:17
Default
  #40
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
dear ArathoN,

Quote:
I let it running until T=30 with a timestep of 2e-4 and the residuals keeps increasing after an interval where they deceased
yeah, exactly, my residuals first decrease to about 1e-6, after a while they increase and they remain constant about 0.01.

Quote:
What did you set in pRefCell and pRefValue? I've set it to 0, you?
I set it 1001.

Quote:
Edit: in perturbU I only changed Retau and I don't know if it's better to set setBulk to true or leave it to false. What did you set? And did any of you change the perturbation properties?
I check the utility code and I found:
Code:
    if (!setBulk && !perturb)
    {
        FatalErrorIn(args.executable())
            << "At least one of setBulk or perturb needs to be set"
            << " to do anything to the velocity"
            << exit(FatalError);
    }
and
Code:
        if (setBulk)
        {
            // laminar parabolic profile
            U[celli] = vector::zero;

            U[celli][streamDir] =
                3.0*Ubar.value()[streamDir] * (y/h - 0.5*sqr(y/h));
        }

        if (perturb)
        {
            // streak streamwise velocity
            U[celli][streamDir] +=
                (utau * duplus/2.0) * (yplus/40.0)
                * Foam::exp(-sigma * Foam::sqr(yplus) + 0.5)
                * Foam::cos(betaPlus*zplus)*deviation;

            // streak spanwise perturbation
            U[celli][spanDir] =
                epsilon
              * Foam::sin(alphaPlus*xplus)
              * yplus
              * Foam::exp(-sigma*Foam::sqr(yplus))
              * deviation;
        }
which if we set the setBulk as true, a laminar parabolic profile will be initiated for velocity.
something from my bones tell me "don't use setBulk, just set perturb as true!!!!"

Regards,
Mostafa


P.S. In my case Re_tau=395, the u_tau value at the beginning of solution is about 0.0079 and then it decreasing to a lower value. AFAIK, at the end of solution it must be about 0.0079.
adambarfi is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
rhoCentralFoam for channel flow fportela OpenFOAM Running, Solving & CFD 22 June 10, 2014 21:14
Question on the boundary condition for open channel flow, please help! ripperjack OpenFOAM Running, Solving & CFD 0 September 13, 2013 12:44
Gravitational water flow in closed channel. Szymon85 CFX 7 September 3, 2013 17:28
[ICEM] Flow channel meshing problems StefanG ANSYS Meshing & Geometry 19 May 15, 2012 07:44
references for how to maintain a constant flow rate in turbulent channel flow amirrstg Main CFD Forum 0 October 25, 2011 04:17


All times are GMT -4. The time now is 00:10.