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

ChannelOodles in OpenFOAM 2.2.2

Register Blogs Community New Posts Updated Threads Search

Like Tree16Likes
  • 1 Post By alexeym
  • 2 Post By wyldckat
  • 5 Post By alexeym
  • 3 Post By alexeym
  • 2 Post By alexeym
  • 1 Post By Alish1984
  • 2 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 10, 2014, 07:49
Default ChannelOodles in OpenFOAM 2.2.2
  #1
Senior Member
 
Join Date: Nov 2012
Location: Bavaria
Posts: 145
Rep Power: 13
aylalisa is on a distinguished road
Dear All,

there are some threads about LES where channelOodles solver is mentioned (and used).
I don't find channelOodles in OF2.2.2. Were did it go?

Aylalisa
aylalisa is offline   Reply With Quote

Old   April 10, 2014, 09:03
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

I guess now it is called channelFoam and it is a part of The OpenFOAM® Extend project (http://www.extend-project.de).
aylalisa likes this.
alexeym is offline   Reply With Quote

Old   April 10, 2014, 15:34
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

channelOodles was renamed to channelFoam when OpenFOAM 1.6 was released. This seems to have been because they generalized the "Oodles" modelling - http://openfoamwiki.net/index.php/Oodles - to the generic single-phase incompressible LES modelling we use in OpenFOAM nowadays.

Then when they released OpenFOAM 2.2.0, they dropped channelFoam entirely, because pimpleFoam is now generic enough to contemplate what only channelFoam was be able to do in past versions. This is also hinted by the transfer of the tutorial "incompressible/channelFoam/channel395" to "incompressible/pimpleFoam/channel395".

I have not tested the two tutorial on each version, namely in OpenFOAM 2.1.x vs 2.2.x, to confirm if the results are similar enough.

As for the channelFoam version present in FOAM-Extend 3.0, it's derived from OpenFOAM 1.6.x.

According to the Git history in FOAM-Extend 3.0 and the compilation from the official OpenFOAM git repositories (available here: https://github.com/wyldckat/OpenFOAM-combo/), it seems that the solver has not evolved in either versions/variants.

Honestly, I suggest that you compare the results from the two tutorials on OpenFOAM 2.2.x or 2.3.x vs the one on OpenFOAM 2.1.x or FOAM-Extend 3.0, to ascertain whether it's worth it or not to use channelFoam.

Best regards,
Bruno
songwukong and aylalisa like this.
__________________
wyldckat is offline   Reply With Quote

Old   April 11, 2014, 03:23
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

wildckat is right, pimpleFoam is more universal as it can handle both LES and RAS turbulence models, and this part of channelFoam:

Code:
        // Extract the velocity in the flow direction
        dimensionedScalar magUbarStar =
            (flowDirection & U)().weightedAverage(mesh.V());
    
        // Calculate the pressure gradient increment needed to
        // adjust the average flow-rate to the correct value
        dimensionedScalar gragPplus =
            (magUbar - magUbarStar)/rUA.weightedAverage(mesh.V());
                
        U += flowDirection*rUA*gragPplus;
                
        gradP += gragPplus;
is now implemented as fvOption and described in system/fvOptions like this:

Code:
momentumSource
{
    type            pressureGradientExplicitSource;
    active          on;            //on/off switch
    selectionMode   all;       //cellSet // points //cellZone

    pressureGradientExplicitSourceCoeffs
    {
        fieldNames  (U);
        Ubar        ( 0.1335 0 0 );
    }
}
And in fact channelFoam from extended project can be compiled with OpenFOAM 2.2.2 (I've checked only this version) with slight modifications, I've attached archive of the modified solver (from 1.6-ext, modifications are mainly in the name of variables and methods to suit 2.2.2) to the message, if you'd like to compare pimpleFoam and channelFoam.
Attached Files
File Type: gz channelFoam.tar.gz (3.1 KB, 36 views)
wyldckat, songwukong, mgg and 2 others like this.
alexeym is offline   Reply With Quote

Old   April 11, 2014, 17:08
Default
  #5
Senior Member
 
Join Date: Nov 2012
Location: Bavaria
Posts: 145
Rep Power: 13
aylalisa is on a distinguished road
Hello Alexey, Hello Bruno,

does this first code snipet guarantee the constant mass flow rate (as described in OpenFOAM Wiki - ChannelOodles)?

(I still have problems reading the code, partly due to lack of physical understanding and a great deal especially due to the numerous templates and the fact that I am still too much of a beginner. Fight is going on.)


Does this mean that, if I set inlet and outlet to cyclic and activate the momentum source, the flow will not die down and finally (depending on the initial flow field) transit to turbulent flow (because of numerical instabilities)?
I read that it is possible with postChannel to extract these different values (in case of a transient simulation): txx, txy,tyy, txy, eps, prod, vorticity, enstrophy, helicity

I see in the code (calculateFields.H) that txx =sqrt(Txx - (UMeanx*UMeanx))
Is UMean the time-averaged volume field of U? I can't figure out the meanding of Txx
Is txx a statistical moment???

If I create some other perturbations source (U + U') as an inlet boundary condition can I then disclaim the cyclic inlet and outlet boundary conditions? Or is that idea unrealistic because of the demanded channel length (and the necessary number of cells)?

I hope that I did not write to many different questions in this post .


Your answers have already helped really much to improve (at least) my understanding!
Thanks a lot!

Aylalisa
aylalisa is offline   Reply With Quote

Old   April 14, 2014, 03:23
Default
  #6
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

1. About fvOptions. If you compare channelFoam source code with pressureGradientExplicitSource source code:

channelFoam.C:
Code:
        // Correct driving force for a constant mass flow rate
            
        // Extract the velocity in the flow direction
        dimensionedScalar magUbarStar =
            (flowDirection & U)().weightedAverage(mesh.V());
    
        // Calculate the pressure gradient increment needed to
        // adjust the average flow-rate to the correct value
        dimensionedScalar gragPplus =
            (magUbar - magUbarStar)/rUA.weightedAverage(mesh.V());

        U += flowDirection*rUA*gragPplus;

        gradP += gragPplus;
pressureGradientExplicitSource.C (correct method)
Code:
    const scalarField& rAU = invAPtr_().internalField();

    // Integrate flow variables over cell set
    scalar magUbarAve = 0.0;
    scalar rAUave = 0.0;
    const scalarField& cv = mesh_.V();
    forAll(cells_, i)
    {
        label cellI = cells_[i];
        scalar volCell = cv[cellI];
        magUbarAve += (flowDir_ & U[cellI])*volCell;
        rAUave += rAU[cellI]*volCell;
    }

    // Collect across all processors
    reduce(magUbarAve, sumOp<scalar>());
    reduce(rAUave, sumOp<scalar>());

    // Volume averages
    magUbarAve /= V_;
    rAUave /= V_;

    // Calculate the pressure gradient increment needed to adjust the average
    // flow-rate to the desired value
    dGradP_ = (mag(Ubar_) - magUbarAve)/rAUave;

    // Apply correction to velocity field
    forAll(cells_, i)
    {
        label cellI = cells_[i];
        U[cellI] += flowDir_*rAU[cellI]*dGradP_;
    }
        
    scalar gradP = gradP0_ + dGradP_;
As you can see, they do more-or-less the same. The difference is mainly due to the fact that code from channelFoam is used outside PISO loop, while fvOptions correct method is called inside PIMPLE loop.

2. About calculateFields.H. Well, in fact all the code in this header is commented out, so it is not used in the utility.

3. It depends on the method you'll be using to create perturbations. AFAIK people successfully use cyclic BCs for LES simulations.
wyldckat, ArathoN and songwukong like this.

Last edited by alexeym; April 14, 2014 at 14:28. Reason: messed up names
alexeym is offline   Reply With Quote

Old   April 15, 2014, 13:44
Default
  #7
Senior Member
 
Join Date: Nov 2012
Location: Bavaria
Posts: 145
Rep Power: 13
aylalisa is on a distinguished road
Hi Alexey,

is it necessary for that 'pressure correction' to be done inside the PIMPLE loop?

The code in calculateFields.H is commented out, but how can I extract the values txx, tyy etc.? Why is it not active anymore?

Do cyclic BCs finally (after enough flows through time) produce turbulence (due to numerical instabilities)with self-similar behaviour?
I've found different methods to create self-similar turbulence, based on superimposing the velocity field with a fluctuation field. Does this proceeding speed up the desired turbulent velocity field?

Best regards,
Aylalisa
aylalisa is offline   Reply With Quote

Old   April 16, 2014, 04:28
Default
  #8
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

1. This way it is implemented in pimpleFoam

Code:
        while (pimple.loop())
        {
            #include "UEqn.H"
    
            // --- Pressure corrector loop
            while (pimple.correct())
            {
                #include "pEqn.H"
            }
    
            if (pimple.turbCorr())
            {
                turbulence->correct();
            }
        }
and in the end of pEqn.H

Code:
U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
fvOptions.correct(U);
Surely you can use fvOptions outside of PIMPLE loop but it will be another solver.

2. I don't know why it's not active. Currently with postChannel you can extract graphs of these values:

Code:
    makeGraph(y, UMeanXvalues, "Uf", path, gFormat);
    makeGraph(y, urmsValues, "u", path, gFormat);
    makeGraph(y, vrmsValues, "v", path, gFormat);
    makeGraph(y, wrmsValues, "w", path, gFormat);
    makeGraph(y, RxyValues, "uv", path, gFormat);
    makeGraph(y, kValues, "k", path, gFormat);

    makeGraph(y, pPrime2MeanValues, "pPrime2Mean", path, gFormat);
And I guess old names Txx, Tyy etc are now Rxx, Ryy etc.

3. Yes, it is possible. Sure if you impose right fluctuations (not just white noise), it will speed up generation of the final flow field.
songwukong and aylalisa like this.
alexeym is offline   Reply With Quote

Old   September 15, 2014, 15:20
Default
  #9
Member
 
Ali Shamooni
Join Date: Oct 2010
Posts: 44
Rep Power: 15
Alish1984 is on a distinguished road
Hi Brunoand others

I have some questions that couldnt find a clear answer to them after reading almost all the stuffs about channel or pipe simulation

1. In channelFoam tutorial, what are the contents of the 0 file? how are they produced? are they from a long time run of the simulation without any perturbed initial condition?

2. what is Ubar or magUbar in channelFoam source? I read the source and I guess that it is averaged velocity over entire volume. then what does it mean? if it was averaged velocity over a cross area then ok, it makes sense. but why does channelFoam tend to meet such a weird condition?

3. I compared results of a channel395 case solving by the pisoFoam and channelFoam for some different conditions
a) channelFoam with initial conditions in 0.org file: no turbulence
b) channelFoam without cyclic BC (turbulentInlet velocity replaced) with IC in 0 file (perturbed IC): turbulence decays

c) pisoFoam with initial conditions in 0.org file without cyclic BC (turbulentInlet velocity replaced): no turbulence
d) pisoFoam without cyclic BC (turbulentInlet velocity replaced) with IC in 0 file (perturbed IC): turbulence decays

then I have this question, it seems that these are cyclic BC and perturbed initial condition both that run the turbulence, is it right?
if it is right then what can we do if we dont want to use cyclic BC in a case?
songwukong likes this.
Alish1984 is offline   Reply With Quote

Old   October 12, 2014, 14:27
Default
  #10
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

@Ali: I've had your post in my to-do list for some time now and I finally managed to look into this today:

Quote:
Originally Posted by Alish1984 View Post
1. In channelFoam tutorial, what are the contents of the 0 file? how are they produced? are they from a long time run of the simulation without any perturbed initial condition?
Possibly used a utility similar to PerturbU: http://www.cfd-online.com/Forums/ope...-perturbu.html - more specifically, the one on this post: http://www.cfd-online.com/Forums/ope...tml#post187619 post #34
Coincidentally, someone else also named Ali asked a similar question back in 2005 and got this answer: http://www.cfd-online.com/Forums/ope...tml#post187629 post #44

Quote:
Originally Posted by Alish1984 View Post
2. what is Ubar or magUbar in channelFoam source? I read the source and I guess that it is averaged velocity over entire volume. then what does it mean? if it was averaged velocity over a cross area then ok, it makes sense. but why does channelFoam tend to meet such a weird condition?
In OpenFOAM 2.1.x, file applications/solvers/incompressible/channelFoam/readTransportProperties.H
has this code:
Quote:
Code:
    //  Read centerline velocity for channel simulations
    dimensionedVector Ubar
    (
        transportProperties.lookup("Ubar")
    );

    dimensionedScalar magUbar = mag(Ubar);
    vector flowDirection = (Ubar/magUbar).value();
Therefore, "Ubar" is the "centerline velocity for channel simulations". The likely reason: if a channel was filled with a fluid going at laminar flow speeds, almost the whole flow speed would be identical; if it's in the turbulent regime, then the speed at the centerline should be the on average similar to the laminar speed... for example, similar to a parabolic flow profile.

Quote:
Originally Posted by Alish1984 View Post
3. I compared results of a channel395 case solving by the pisoFoam and channelFoam for some different conditions
a) channelFoam with initial conditions in 0.org file: no turbulence
b) channelFoam without cyclic BC (turbulentInlet velocity replaced) with IC in 0 file (perturbed IC): turbulence decays

c) pisoFoam with initial conditions in 0.org file without cyclic BC (turbulentInlet velocity replaced): no turbulence
d) pisoFoam without cyclic BC (turbulentInlet velocity replaced) with IC in 0 file (perturbed IC): turbulence decays

then I have this question, it seems that these are cyclic BC and perturbed initial condition both that run the turbulence, is it right?
if it is right then what can we do if we dont want to use cyclic BC in a case?
I think I found a paper a few minutes ago that state that pimpleFoam or channelFoam modified to use PIMPLE would give the best results... ah, it's this one: http://congress.cimne.com/eccomas/cf...pers/01454.pdf
Just in case the link gets broken in the future, the paper specifics:
  • OPENFOAM SIMULATION OF MASS TRANSFER IN SPACER-FILLED CHANNELS
  • José L.C. Santos, João G. Crespo, Vítor Geraldes
  • V European Conference on Computational Fluid Dynamics, ECCOMAS CFD 2010


As for the tests and questions you made on this point:
  1. cyclic BCs were used with an initial field value, because it's trying to quickly simulate how a section of fluid inside a channel would behave. For example, if the channel is as big as 10km by 500m, and you only want to study how 100m x 100m section of fluid behaves over a period of time, it's not necessary to mesh the whole channel of 10km by 500m, it's just a matter of meshing only the 100m by 100m and using cyclic BCs.
  2. I'm not sure I understood your 2 questions. I say this because if I understood you correctly, it seems you have not tried/studied any other tutorial example in OpenFOAM's "tutorials" folder, which many exemplify how to set-up and use turbulence modelling. Perhaps you can detail a bit more what you're asking?
Best regards,
Bruno
songwukong and ancipdp like this.
__________________
wyldckat is offline   Reply With Quote

Reply


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
OpenFoam 2.3.0 vs 2.2.2 Parallel Running tomank OpenFOAM Pre-Processing 1 March 21, 2014 17:39
OpenFOAM 2.2.2 Maimouna OpenFOAM 1 October 14, 2013 13:30
OpenFOAM Foundation releases OpenFOAM 2.2.2 opencfd OpenFOAM Announcements from ESI-OpenCFD 0 October 14, 2013 07:18
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 wyldckat OpenFOAM Announcements from Other Sources 3 September 8, 2010 06:25
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 18:07


All times are GMT -4. The time now is 18:48.