CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Outflow boundary condition for a boussinesq fluid (http://www.cfd-online.com/Forums/openfoam-solving/66275-outflow-boundary-condition-boussinesq-fluid.html)

 lin July 10, 2009 06:37

Outflow boundary condition for a boussinesq fluid

Hi

I am considering which outflow BC should be used for a boussinesq fluid.

While for a constant density fluid,it seems that I could just choose a fixedValue(0) pressure BC for the outflow. I think this is not right for a density fluid with boussinesq approximation.

Any one have any idea or experience for setting outflow boundary conditions for such flow?

Best wishes.

 Thomas Baumann July 22, 2009 07:51

I think you can use the fixedValue for pressure at the outflow for boussinesq fluid, because the flow problem is solved incompressible, there is only an additional term in the momentum-equations beta*g*(delta T).
The density doesn't change its value for the whole simulation.

Regards, Thomas

 sandy July 22, 2009 18:44

Hi Thomas, there is an additional term

- fvm::Sp(fvc::ddt(rho) + fvc::div(rhoPhi), U)

in UEqn.H of the interPhaseChangeFoam solver. Do you know why? It is also about the density change, right?

Thanks.

 chiven July 23, 2009 06:48

Hi, dear Hua, Thomas and Sandy, do you have any comments with my problem? Thank you in advance.

When I run the boussinesqBuoyantSimpleFoam solver on my case, the following error appears:
Time = 0.05
DILUPBiCG: Solving for Ux, Initial residual = 0.989258, Final residual = 0.0103564, No Iterations 1
DILUPBiCG: Solving for Uy, Initial residual = 0.973745, Final residual = 0.0111817, No Iterations 1
DILUPBiCG: Solving for Uz, Initial residual = 0.975119, Final residual = 0.00821149, No Iterations 1
GAMG: Solving for p, Initial residual = 9.53872e-06, Final residual = 5.94514e-07, No Iterations 1
time step continuity errors : sum local = 1.07053e+17, global = -1.94455e+13, cumulative = -1.94455e+13
DILUPBiCG: Solving for epsilon, Initial residual = 1, Final residual = 0.00430228, No Iterations 1
bounding epsilon, min: -1.3712e+37 max: 4.32279e+38 average: 7.36798e+32
#0 _ZN4Foam5error10printStackERNS_7OstreamE-0xb34150
in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so"
in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so"
#2 Uninterpreted: [0xa0000000000107e0]
#3 _ZNK4Foam13LimitedSchemeIdNS_14vanLeerLimiterINS_6 NVDTVDEEENS_10limitFuncs6magSqrEE7limiterERKNS_14G eometricFieldIdNS_12fvPatchFieldENS_7volMeshEEE-0x1d0538e
in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/lib/linuxIA64GccDPOpt/libfiniteVolume.so"
#4 _ZNK4Foam33limitedSurfaceInterpolationSchemeIdE7we ightsERKNS_14GeometricFieldIdNS_12fvPatchFieldENS_ 7volMeshEEE-0x1f1c680
in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/lib/linuxIA64GccDPOpt/libfiniteVolume.so"
#5 _ZNK4Foam2fv21gaussConvectionSchemeIdE6fvmDivERKNS _14GeometricFieldIdNS_13fvsPatchFieldENS_11surface MeshEEERNS3_IdNS_12fvPatchFieldENS_7volMeshEEE-0x1f192a0
in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/lib/linuxIA64GccDPOpt/libfiniteVolume.so"
#6 Foam::tmp<Foam::fvMatrix<double> > Foam::fvm::div<double>(Foam::GeometricField<double , Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::word const&) in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxIA64GccDPOpt/boussinesqBuoyantSimpleFoam"
#7 Foam::tmp<Foam::fvMatrix<double> > Foam::fvm::div<double>(Foam::GeometricField<double , Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&) in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxIA64GccDPOpt/boussinesqBuoyantSimpleFoam"
#8 _ZN4Foam10boussinesq9RASModels8kEpsilon7correctEv-0x28bce90
in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/lib/linuxIA64GccDPOpt/libboussinesqRASModels.so"
#9 main in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxIA64GccDPOpt/boussinesqBuoyantSimpleFoam"
#10 __libc_start_main-0x734df0
in "/lib/tls/libc.so.6.1"
#11 _start in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxIA64GccDPOpt/boussinesqBuoyantSimpleFoam"
Floating exception

 Thomas Baumann July 24, 2009 11:47

Hi chiven,
the problems are the time step continuity errors. They are about -1.94455e+13 and the epsilon residuals..
I had big at the beginning big problems with correct boundary conditions and got floating point errors...

Check that they are set right:

inlet:
-U fixedValue (check the direction of the velocity-tensor)
-k fixedValue
-T fixedValue
-Epsilon fixedValue

outlet:
-p fixedValue

walls:
-U fixedValues

Good luck, Thomas

 chiven July 25, 2009 22:20

Hi, Thomas, thank you for your suggestions. I have checked the boundary conditions carefully and used what you suggested. However, the same problem is met. The meshes are from Fluent, and good results can be obtained from Fluent. I only try to do some calculations using OpenFOAM and compare to Fluent. I am struggling for this problem for a long time.

best regards,
Chiven

__________________________________________________ __________________________________________
DILUPBiCG: Solving for Ux, Initial residual = 0.989258, Final residual = 0.0103564, No Iterations 1
DILUPBiCG: Solving for Uy, Initial residual = 0.973745, Final residual = 0.0111817, No Iterations 1
DILUPBiCG: Solving for Uz, Initial residual = 0.975119, Final residual = 0.00821149, No Iterations 1
GAMG: Solving for p, Initial residual = 9.53872e-06, Final residual = 5.94514e-07, No Iterations 1
time step continuity errors : sum local = 1.07053e+19, global = -1.94455e+15, cumulative = -1.94455e+15
DILUPBiCG: Solving for epsilon, Initial residual = 1, Final residual = 0.00430228, No Iterations 1
bounding epsilon, min: -1.3712e+37 max: 4.32279e+38 average: 7.36798e+32
#0 _ZN4Foam5error10printStackERNS_7OstreamE-0xb34150
in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so"
in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so"
#2 Uninterpreted: [0xa0000000000107e0]
#3 _ZNK4Foam13LimitedSchemeIdNS_14vanLeerLimiterINS_6 NVDTVDEEENS_10limitFuncs6magSqrEE7limiterERKNS_14G eometricFieldIdNS_12fvPatchFieldENS_7volMeshEEE-0x1d0538e
in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/lib/linuxIA64GccDPOpt/libfiniteVolume.so"
#4 _ZNK4Foam33limitedSurfaceInterpolationSchemeIdE7we ightsERKNS_14GeometricFieldIdNS_12fvPatchFieldENS_ 7volMeshEEE-0x1f1c680
in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/lib/linuxIA64GccDPOpt/libfiniteVolume.so"
#5 _ZNK4Foam2fv21gaussConvectionSchemeIdE6fvmDivERKNS _14GeometricFieldIdNS_13fvsPatchFieldENS_11surface MeshEEERNS3_IdNS_12fvPatchFieldENS_7volMeshEEE-0x1f192a0
in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/lib/linuxIA64GccDPOpt/libfiniteVolume.so"
#6 Foam::tmp<Foam::fvMatrix<double> > Foam::fvm::div<double>(Foam::GeometricField<double , Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::word const&) in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxIA64GccDPOpt/boussinesqBuoyantSimpleFoam"
#7 Foam::tmp<Foam::fvMatrix<double> > Foam::fvm::div<double>(Foam::GeometricField<double , Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&) in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxIA64GccDPOpt/boussinesqBuoyantSimpleFoam"
#8 _ZN4Foam10boussinesq9RASModels8kEpsilon7correctEv-0x28bce90
in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/lib/linuxIA64GccDPOpt/libboussinesqRASModels.so"
#9 main in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxIA64GccDPOpt/boussinesqBuoyantSimpleFoam"
#10 __libc_start_main-0x734df0
in "/lib/tls/libc.so.6.1"
#11 _start in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxIA64GccDPOpt/boussinesqBuoyantSimpleFoam"
Floating exception

 henrik July 26, 2009 04:19

Dear Cieven,

you have a very large time step continuity. Please output a time step and have a look at the flow field it should give you an idea which boundary is wrong.

Henrik

 chiven July 26, 2009 06:05

Hello, Henrik, thank you very much for your valuable suggestions. I shall do it right now. I have just ONLY use the simpleFoam to calculate the case. I found that the iterative number for solving p is very large.

Time = 1
DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 0.00959869, No Iterations 2
DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 0.0392132, No Iterations 1
DILUPBiCG: Solving for Uz, Initial residual = 1, Final residual = 0.0933601, No Iterations 1
DICPCG: Solving for p, Initial residual = 1, Final residual = 0.00988232, No Iterations 951
time step continuity errors : sum local = 0.000578384, global = 1.26735e-05, cumulative = 1.26735e-05
DILUPBiCG: Solving for epsilon, Initial residual = 0.15321, Final residual = 0.0097108, No Iterations 1
bounding epsilon, min: -0.000799335 max: 0.159935 average: 0.00621144
DILUPBiCG: Solving for k, Initial residual = 1, Final residual = 0.0139229, No Iterations 2
ExecutionTime = 1212.63 s ClockTime = 1216 s

 henrik July 26, 2009 06:24

Chiven,

yes, this is another route you may try: Get simpler codes to work. However, my bet is that your boundary conditions, mesh, schemes or solution parameters or so messed up that nothing will work.

I also noticed

Time = 0.05

in post #4. Not that it matters, but the "time step" should be 1 for boussinesqBuoyantSimpleFoam.

Henrik

 chiven July 26, 2009 06:30

hi, Henrik, thank you so much. You are right. I have also noticed this problem. And the simpleFoam meets the same problems like boussinesqBuoyantSimpleFoam. The following results are from simpleFoam.
Best regards,
Chiven

Time = 11
DILUPBiCG: Solving for Ux, Initial residual = 2.44868e-05, Final residual = 1.07567e-07, No Iterations 1
DILUPBiCG: Solving for Uy, Initial residual = 8.85825e-05, Final residual = 7.61361e-07, No Iterations 1
DILUPBiCG: Solving for Uz, Initial residual = 0.000162127, Final residual = 2.14391e-07, No Iterations 1
DICPCG: Solving for p, Initial residual = 5.65597e-07, Final residual = 5.65597e-07, No Iterations 0
time step continuity errors : sum local = 1.48069e+25, global = 6.16218e+10, cumulative = -4.12313e+10
DILUPBiCG: Solving for epsilon, Initial residual = 1.88982e-12, Final residual = 1.88982e-12, No Iterations 0
bounding epsilon, min: 7.47085e-21 max: 1.23994e+73 average: 3.73395e+67
DILUPBiCG: Solving for k, Initial residual = 3.48683e-12, Final residual = 3.48683e-12, No Iterations 0
ExecutionTime = 2757.74 s ClockTime = 2762 s
Time = 12
DILUPBiCG: Solving for Ux, Initial residual = 1.80298e-05, Final residual = 2.57007e-08, No Iterations 1
DILUPBiCG: Solving for Uy, Initial residual = 7.42283e-05, Final residual = 1.37196e-07, No Iterations 1
DILUPBiCG: Solving for Uz, Initial residual = 4.26046e-05, Final residual = 8.07066e-08, No Iterations 1
DICPCG: Solving for p, Initial residual = 9.44909e-07, Final residual = 9.44909e-07, No Iterations 0
time step continuity errors : sum local = 1.90137e+25, global = 1.28564e+11, cumulative = 8.73329e+10
DILUPBiCG: Solving for epsilon, Initial residual = 1.88982e-12, Final residual = 1.88982e-12, No Iterations 0
bounding epsilon, min: 7.47085e-21 max: 1.23994e+73 average: 3.73395e+67
DILUPBiCG: Solving for k, Initial residual = 2.35561e-12, Final residual = 2.35561e-12, No Iterations 0
ExecutionTime = 2816.46 s ClockTime = 2820 s
Time = 13
DILUPBiCG: Solving for Ux, Initial residual = 9.76122e-06, Final residual = 9.76122e-06, No Iterations 0
DILUPBiCG: Solving for Uy, Initial residual = 2.55133e-05, Final residual = 6.15858e-08, No Iterations 1
DILUPBiCG: Solving for Uz, Initial residual = 2.17068e-05, Final residual = 3.06414e-08, No Iterations 1
#0 _ZN4Foam5error10printStackERNS_7OstreamE-0xb383f0
in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so"
#1 _ZN4Foam6sigFpe13sigFpeHandlerEi-0xb01820
in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so"
#2 Uninterpreted: [0xa0000000000107e0]
#3 _ZN4Foam17DICPreconditioner15calcReciprocalDERNS_5 FieldIdEERKNS_9lduMatrixE-0xef5f6e
in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so"
#4 _ZN4Foam17DICPreconditionerC1ERKNS_9lduMatrix6solv erERNS_7IstreamE-0xef5a60
in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so"
in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so"
in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so"
#7 _ZNK4Foam3PCG5solveERNS_5FieldIdEERKS2_h-0xf10a80
in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so"
#8 _ZN4Foam8fvMatrixIdE5solveERNS_7IstreamE-0x1f46d10
in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/lib/linuxIA64GccDPOpt/libfiniteVolume.so"
#9 main in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxIA64GccDPOpt/simpleFoam"
#10 __libc_start_main-0x739080
in "/lib/tls/libc.so.6.1"
#11 _start in "/home/g2/e090012/OpenFOAM/OpenFOAM-1.5/applications/bin/linuxIA64GccDPOpt/simpleFoam"
Floating exception

 chiven July 26, 2009 21:35

Hi, Henrik, good morning. I output a time step, and find phi is wrong obviously. Therefore, I use potentialFoam to calculate the case. The iterative number solving p is large. The output phi is not reasonable. I post the output, boundary conditions and system files. Would you please give me some comments furtherly? I am wondering why some of the U are so large. Thank you very much.
With best regards,
Chiven

 henrik July 27, 2009 03:40

Dear Chiven,

You switched off ALL convection terms:
Quote:
 divSchemes { default none; }
Use upwind for the moment.

It's a massive geometry - 3 Million cells, two symmetry planes, two inlets ... Is the mesh correct? run checkMesh.

If the problem persists ... Please have a look at a first dump to find out on which boundary is goes wrong.

Last but get a simpler case to work and build up on that. You are tying to do something serious while missing the basics.

Henrik

 chiven July 27, 2009 04:03

Dear Henrik, thanks. I have run checkMesh, Mesh is OK. The mesh is from Fluent. I am sorry for the complicated case. My work is including to calculate the case and do the comparison with Fluent. However thing is moving along difficultly.

Best regards,
Chiven

 sandy July 28, 2009 21:43

Quote:
 Originally Posted by chiven (Post 224194) Hi, Henrik, good morning. I output a time step, and find phi is wrong obviously. Therefore, I use potentialFoam to calculate the case. The iterative number solving p is large. The output phi is not reasonable. I post the output, boundary conditions and system files. Would you please give me some comments furtherly? I am wondering why some of the U are so large. Thank you very much. With best regards, Chiven
Hi Chiven, how can you juge whether the phi is reasonable or not?

 chiven July 28, 2009 21:55

Hi, Sandy, you can see the value of phi and judge it based on the concrete case. In my case, I think the output of phi is unreasonable before there are too much backflow in the outlet. Do you think so?

best regards,
Chiven

 sandy July 28, 2009 22:51

Quote:
 Originally Posted by chiven (Post 224501) Hi, Sandy, you can see the value of phi and judge it based on the concrete case. In my case, I think the output of phi is unreasonable before there are too much backflow in the outlet. Do you think so? best regards, Chiven
Hi Chiven, the mesh of my case creats by Gambit, so, you think, how can I know which part datum are the output datum in phi? :o

In addition, somebody think, to turbulent problems, the "zerogradient" bc can not be chose because they are afraid of the effection of the backflow in outlet. What about your thought?

 chiven July 29, 2009 00:05

Hi, Sandy, you can try to use potentialFoam to calculate it.

It is right, for outflow with U of zeroGradient, the transported quantities such as k, epsilon, can not be setted as zeroGradient. For this condition, inletOutlet is OK.

best regards,
Chiven

 henrik July 29, 2009 03:38

Chiven,

if you have inflow through your outlet, you may try

outlet:
-U inletOutlet, inletValue (0 0 0)
-k inletOutlet, inletValue "something small"
-epsilon inletOutlet, inletValue "something small"
-T inletOutlet, inletValue "something reasonable"
-p fixedValue

Henrik

 chiven July 29, 2009 05:50

Hi, Henrik, thank you very much.
Now I find a very interesting thing. I set inlet U as fixedValue 0, and run potentialFoam, some velocities are very large. Though the mesh is shown OK by checkMesh, and also OK for fluent, I doubt it still need to be better for OpenFOAM furtherly. Now I shall do a very simple case as beginning. However time is very limited, I am worried about my research.

best regards,
Chiven

 sandy July 31, 2009 08:50

Quote:
 Originally Posted by henrik (Post 224529) Chiven, if you have inflow through your outlet, you may try outlet: -U inletOutlet, inletValue (0 0 0) -k inletOutlet, inletValue "something small" -epsilon inletOutlet, inletValue "something small" -T inletOutlet, inletValue "something reasonable" -p fixedValue Henrik
Hi Henrik, the inletOutlet and outletInlet can also be used in k, epsilon and T as BC ?? However, in user's guide, they are "Switches U and p between fixedValue and zeroGradient depending on direction of U". If I used in k, epsilon, gamma, T and so on, which direction should I depend on? You think.

In addition, how to specify the inletValue, value and outletValue, value to the inletOutlet and outletInlet BC ? Giving a example, if I specify a inlet velocity (4 0 0) to U field, can I set a inletOutlet BC in the far field as follows:

U:outlet
{
type inletOutlet;
inletValue uniform(4 0 0);
value uniform(4 0 0);
}

Yesterday, I specify the outletInlet BC to the p outlet and give the outletValue and value 0 in my case, I don't know why the turbulence field of U became into "laminar" ? Please help me out. Thanks.

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