CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (http://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   simple open channel flow, the inlet and outlet are periodic (http://www.cfd-online.com/Forums/openfoam-pre-processing/122375-simple-open-channel-flow-inlet-outlet-periodic.html)

Sniper August 18, 2013 15:15

simple open channel flow, the inlet and outlet are periodic
 
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.

wyldckat August 18, 2013 15:27

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

Sniper August 18, 2013 18:52

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.

wyldckat August 18, 2013 19:44

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

Sniper August 18, 2013 21:47

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.

wyldckat August 19, 2013 12:15

Hi Vimal,

Quote:

Originally Posted by Sniper (Post 446528)
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

Sniper August 22, 2013 09:59

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

wyldckat August 22, 2013 10:42

Quote:

Originally Posted by Sniper (Post 447459)
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.

Sniper August 22, 2013 12:36

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.

wyldckat August 22, 2013 12:41

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

Sniper August 22, 2013 15:11

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.

wyldckat August 22, 2013 17:13

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

Sniper August 23, 2013 13:59

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.

wyldckat August 24, 2013 17:49

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

Sniper August 25, 2013 18:25

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.

wyldckat August 26, 2013 17:14

Hi Vimal,

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

Best regards,
Bruno

Sniper August 28, 2013 11:22

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.

Lieven August 28, 2013 12:25

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

Sniper November 28, 2013 12:49

Open channel Flow with VOF
 
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,

wyldckat November 29, 2013 15:56

Quote:

Originally Posted by Sniper (Post 463927)
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


All times are GMT -4. The time now is 16:24.