CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

simple open channel flow, the inlet and outlet are periodic

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 18, 2013, 16:15
Default simple open channel flow, the inlet and outlet are periodic
  #1
New Member
 
Vimaldoss Jesudhas
Join Date: Aug 2013
Posts: 15
Rep Power: 13
Sniper is on a distinguished road
Hi Bruno,

Thank you very much for the information... I was able to convert it and just as you predicted the resultant mesh was not very good.

As a result, I am trying to run the case in OpenFoam. My domain is a simple open channel flow, the inlet and outlet are periodic, so I have to apply the cyclic or cyclicAMI boundry condition. But I need to specify the mass flow rate at the inlet and outlet as well. Is there a way to specify the mass flow rate and also apply cyclic boundary condition.

Kindly suggest me, if there is anything else that I may have to try.
Sniper is offline   Reply With Quote

Old   August 18, 2013, 16:27
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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
Hi Vimaldoss,

I've moved your post from this thread: http://www.cfd-online.com/Forums/ope...esh-o-f-3.html - to a new thread, because the question was off-topic.

I was going to tell you to check the OpenFOAM tutorial "incompressible/simpleFoam/pipeCyclic". But it's different from your description, because this tutorial has a fixed inlet flow and the cyclic is around the main pipe axis.

Honestly, I can't remember any tutorial that does what you're asking about. But I know this has been asked here on the forum more than once.
So, I suggest that you search here on the forum for more information. Let us know what you can find.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   August 18, 2013, 19:52
Default
  #3
New Member
 
Vimaldoss Jesudhas
Join Date: Aug 2013
Posts: 15
Rep Power: 13
Sniper is on a distinguished road
Hi Bruno,

Thanks for your reply... I was looking at different tutorials for a solution to this problem. I came across a tutorial with a boundary condition called mapped.

Would it work in case of my problem? Would I be able to map the inlet velocity profile on the outlet? Do have any experience using this boundary condition?

Also what does the term 'offset' mean in this mapped boundary condition?

Also could you suggest any tutorials for instructions on how to give velocity profiles at the inlet.

Thanks ,

Vimal.
Sniper is offline   Reply With Quote

Old   August 18, 2013, 20:44
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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
Hi Vimal,

Of course! The mapped BC, I wasn't remembering it. One such tutorial is "incompressible/pisoFoam/les/pitzDailyMapped".
And as of OpenFOAM 2.2, you can find more details about boundary conditions and function objects here: http://foam.sourceforge.net/docs/cpp/modules.html

What you're looking for is in the section Coupled boundary Conditions

The general idea is that:
  1. You define in the file "constant/polyMesh/boundary" the geometrical relation between two patches, where one is the slave and the other the master.
    The offset is defined here and is the indication of the relative position between the current patch and the other patch. For example, if your "inlet" is at "X= -5.0m" and the "outlet" is at "X=+10.0m", and if the "inlet" is the one that is defined as the "mappedPatch", then the offset is "(15.0 0 0)". Well, actually, it might have to be "(14.99 0 0)", so that the offset point falls inside the cells that are near the "outlet" patch.
    If the "outlet" was the "mappedPatch", then the offset would be "(-15.0 0 0)"... I mean, "(-14.99 0 0)".
  2. As for the type you defined for the "inlet" in "0/U", it depends on the specific mapped type you're looking for, as listed in the Coupled boundary Conditions.
Best regards,
Bruno
beatlejuice and randolph like this.
__________________
wyldckat is offline   Reply With Quote

Old   August 18, 2013, 22:47
Default
  #5
New Member
 
Vimaldoss Jesudhas
Join Date: Aug 2013
Posts: 15
Rep Power: 13
Sniper is on a distinguished road
Hi Bruno,

Thanks for your reply.

I will run the case using the mapped BC and compare with the StarCCM results and keep the community posted.

Is there a way to port the data from openFOAM to tecplot for post processing?

Thanks & Regards,

Vimal.
Sniper is offline   Reply With Quote

Old   August 19, 2013, 13:15
Default
  #6
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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
Hi Vimal,

Quote:
Originally Posted by Sniper View Post
Is there a way to port the data from openFOAM to tecplot for post processing?
Either use the native capability that Tecplot has got (I can't remember which version), or use the utility foamToTecplot360. You should be able to find references for both methods here on the forum.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   August 22, 2013, 10:59
Default
  #7
New Member
 
Vimaldoss Jesudhas
Join Date: Aug 2013
Posts: 15
Rep Power: 13
Sniper is on a distinguished road
Hi Bruno,

I have not been able to still setup the case. Could you let me know why does a simpleFoam a steady state solver has a initial conditions file in motorBike tutorial.

Regards,

Vimal
Sniper is offline   Reply With Quote

Old   August 22, 2013, 11:42
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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
Quote:
Originally Posted by Sniper View Post
Could you let me know why does a simpleFoam a steady state solver has a initial conditions file in motorBike tutorial.
I'm not sure I understand you question. Are you asking about the files located at "incompressible/simpleFoam/motorBike/0.org/include"?

If that's the question, then it's simple: this tutorial also demonstrates OpenFOAM's ability to include other files inside existing fields and dictionary files. This is helpful for when we have several variables that we want to configure outside of the field files, without having to look inside each file, looking for which to change. This way, you define the common variables in a single file, then "#include" that file inside each relevant field or dictionary file and use the respective variable (e.g. "$Temperature") inside those field/dictionary files.
__________________
wyldckat is offline   Reply With Quote

Old   August 22, 2013, 13:36
Default
  #9
New Member
 
Vimaldoss Jesudhas
Join Date: Aug 2013
Posts: 15
Rep Power: 13
Sniper is on a distinguished road
Hi Bruno,

The reason I asked about that tutorial was, I thought I can make make my inlet and outlet as cyclic and can give the velocity as an initial condition. Do you think this would work?

Regards,

Vimal.
Sniper is offline   Reply With Quote

Old   August 22, 2013, 13:41
Default
  #10
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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
Hi Vimal,

The only thing that comes to mind is for you to define the inlet and outlet as cyclic patches and define the internal field with the initial value.

Other than that, you'll have to use the mapped BC types.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   August 22, 2013, 16:11
Default
  #11
New Member
 
Vimaldoss Jesudhas
Join Date: Aug 2013
Posts: 15
Rep Power: 13
Sniper is on a distinguished road
Hi Bruno,

Giving the velocity as the initial condition does work with simpleFoam solver. The entire domain is set to that velocity value and there is no variation.

I am trying to setup the case using mapped BC. I am trying to specify a massFlowRate at the outlet and trying to map the inlet to that value.

My 0/U file entires are

Code:
Outlet
    {
    type        flowRateInletVelocity;
    rho         1000;
    massflowRate    48;        // Volumetric/mass flow rate [m3/s or kg/s]
    value       uniform (0 0 0); // placeholder
    }
    Inlet
    {
    type            mappedFlowRate;
    rho        rho;
    phi        phi;
    neigPhi        flowRate;
    value           uniform (0 0 0); // placeholde
    }
But I seem to get this error:

Code:
 --> FOAM FATAL IO ERROR: 
Please supply either 'volumetricFlowRate' or 'massFlowRate' and 'rho'
But as you can see from the file I have already specified the values.

Your suggestions will be very helpful.

Thanks & Regards,

Vimal.

Last edited by wyldckat; August 22, 2013 at 18:07. Reason: Added [CODE][/CODE]
Sniper is offline   Reply With Quote

Old   August 22, 2013, 18:13
Default
  #12
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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
Hi Vimal,

OpenFOAM requires users to be extremely careful with details. One such details is that OpenFOAM is (mostly) case sensitive.

In other words, where you have "massflowRate" should be "massFlowRate".

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   August 23, 2013, 14:59
Default
  #13
New Member
 
Vimaldoss Jesudhas
Join Date: Aug 2013
Posts: 15
Rep Power: 13
Sniper is on a distinguished road
Hi Bruno,

Thanks for your help.

Could you point me to any tutorial we I can give velocity profile at my inlet.

Thanks & Regards,

Vimal.
Sniper is offline   Reply With Quote

Old   August 24, 2013, 18:49
Default
  #14
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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
Hi Vimal,

The only one I'm aware of in OpenFOAM is the tutorial "incompressible/simpleFoam/pitzDailyExptInlet", which uses a table list of values defined at each point in the inlet patch.

Beyond this, you can find several examples of other ways on defining profile velocities here in the forum, among which are:
  • Using GroovyBC (which is part of swak4Foam).
  • Coding your own boundary condition, either:
    • Directly as a new boundary condition, namely by creating a small library based on an existing boundary condition.
    • Or indirectly, namely by using the "codeStream" feature, and coding the values directly in the "U" field file.
One of the most common is the parabolic velocity profile: http://www.cfd-online.com/Forums/ope...tml#post446451 post #10 - but read the previous posts as well, since they provide some additional insight.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   August 25, 2013, 19:25
Default
  #15
New Member
 
Vimaldoss Jesudhas
Join Date: Aug 2013
Posts: 15
Rep Power: 13
Sniper is on a distinguished road
Hi Bruno,

Thanks for your suggestions, it helped me a lot. I am right now trying to use the command foamToTecplot360, it does not seem to work. I get the following error

foamToTecplot360: command not found

Do I need additional packages for the function to work.

Thanks & Regards,

Vimal.
Sniper is offline   Reply With Quote

Old   August 26, 2013, 18:14
Default
  #16
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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
Hi Vimal,

Follow the instructions from here: https://github.com/wyldckat/localFoamToTecplot360

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   August 28, 2013, 12:22
Default
  #17
New Member
 
Vimaldoss Jesudhas
Join Date: Aug 2013
Posts: 15
Rep Power: 13
Sniper is on a distinguished road
Hi Bruno,

Thanks for the link, it was very helpful.

For my problem, I am trying to run with a mapped inlet boundary and trying to map the flow parameters at the outlet on the inlet. But when I run the case using simpleFoam I get the following error could you enlighten me on that

Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting RAS turbulence model kEpsilon
bounding k, min: 0 max: 2e-05 average: 2e-05
bounding epsilon, min: 0 max: 20 average: 20
#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2   in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4  void Foam::divide<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so"
#5   at kEpsilon.C:0
#6  Foam::incompressible::RASModels::kEpsilon::kEpsilon(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&, Foam::word const&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so"
#7  Foam::incompressible::RASModel::adddictionaryConstructorToTable<Foam::incompressible::RASModels::kEpsilon>::New(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so"
#8  Foam::incompressible::RASModel::New(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) in "/opt/openfoam221/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so"
#9  
 in "/opt/openfoam221/platforms/linux64GccDPOpt/bin/simpleFoam"
#10  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#11  
 in "/opt/openfoam221/platforms/linux64GccDPOpt/bin/simpleFoam"
Floating point exception (core dumped)
Best Regards,

Vimal.

Last edited by wyldckat; August 28, 2013 at 15:52. Reason: Added [CODE][/CODE]
Sniper is offline   Reply With Quote

Old   August 28, 2013, 13:25
Default
  #18
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 23
Lieven will become famous soon enough
Hi Vimal,

Make sure epsilon is larger than 0.0 in each cell of the whole domain. If it is equal to 0.0 somewhere, this would result in the floating point error when the turbulence model tries to compute nut:
Code:
nut_ = Cmu_*sqr(k_)/epsilon_;
Regards,

L
wyldckat and hulli like this.
Lieven is offline   Reply With Quote

Old   November 28, 2013, 12:49
Default Open channel Flow with VOF
  #19
New Member
 
Vimaldoss Jesudhas
Join Date: Aug 2013
Posts: 15
Rep Power: 13
Sniper is on a distinguished road
Hi

I am planning to model a simple open channel flow with VOF for free surface. I am using the interFoam solver based on the water channel tutorial. I want to specify a desired water depth at the inlet and also a mixed alpha1 condition at the inlet.

Your suggestions will be of great help. Also, I read from the form that groovyBC would be helpful in specifying such condition. Could you provide me some help on how to install this library to Openfoam.

Thanks,
Sniper is offline   Reply With Quote

Old   November 29, 2013, 15:56
Default
  #20
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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
Quote:
Originally Posted by Sniper View Post
Could you provide me some help on how to install this library to Openfoam.
Quick answer:
  1. Step 1, download: http://openfoamwiki.net/index.php/Co...am#Downloading
  2. Step 2, build: http://openfoamwiki.net/index.php/Co...4Foam#Building
  3. Step 3, read the whole wikipage: http://openfoamwiki.net/index.php/Contrib/swak4Foam
Best regards,
Bruno
__________________
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
Open Channel Flow ElanMorin FLUENT 4 February 25, 2015 17:26
Net mass flow inlet vs outlet Nigui28 FLUENT 1 August 12, 2011 11:09
Outlet condition for open channel flow? gareth__it_power OpenFOAM Running, Solving & CFD 1 July 17, 2011 04:44
pressure outlet (open channel flow) Willem Brantegem FLUENT 2 April 4, 2007 03:40
pressure outlet (open channel flow) Willem Brantegem Main CFD Forum 0 April 3, 2007 10:39


All times are GMT -4. The time now is 14:49.