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. 
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 momentumequations beta*g*(delta T).
The density doesn't change its value for the whole simulation. Regards, Thomas 

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.53872e06, Final residual = 5.94514e07, 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_7OstreamE0xb34150 in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so" #1 _ZN4Foam6sigFpe13sigFpeHandlerEi0xad1820 in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so" #2 Uninterpreted: [0xa0000000000107e0] #3 _ZNK4Foam13LimitedSchemeIdNS_14vanLeerLimiterINS_6 NVDTVDEEENS_10limitFuncs6magSqrEE7limiterERKNS_14G eometricFieldIdNS_12fvPatchFieldENS_7volMeshEEE0x1d0538e in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/lib/linuxIA64GccDPOpt/libfiniteVolume.so" #4 _ZNK4Foam33limitedSurfaceInterpolationSchemeIdE7we ightsERKNS_14GeometricFieldIdNS_12fvPatchFieldENS_ 7volMeshEEE0x1f1c680 in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/lib/linuxIA64GccDPOpt/libfiniteVolume.so" #5 _ZNK4Foam2fv21gaussConvectionSchemeIdE6fvmDivERKNS _14GeometricFieldIdNS_13fvsPatchFieldENS_11surface MeshEEERNS3_IdNS_12fvPatchFieldENS_7volMeshEEE0x1f192a0 in "/home/g2/e090012/OpenFOAM/OpenFOAM1.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/OpenFOAM1.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/OpenFOAM1.5/applications/bin/linuxIA64GccDPOpt/boussinesqBuoyantSimpleFoam" #8 _ZN4Foam10boussinesq9RASModels8kEpsilon7correctEv0x28bce90 in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/lib/linuxIA64GccDPOpt/libboussinesqRASModels.so" #9 main in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/applications/bin/linuxIA64GccDPOpt/boussinesqBuoyantSimpleFoam" #10 __libc_start_main0x734df0 in "/lib/tls/libc.so.6.1" #11 _start in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/applications/bin/linuxIA64GccDPOpt/boussinesqBuoyantSimpleFoam" Floating exception 
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 velocitytensor) k fixedValue T fixedValue Epsilon fixedValue p zeroGradient outlet: U zeroGradient k zeroGradient T zeroGradient Epsilon zeroGradient p fixedValue walls: epsilon zeroGradient k zeroGradient T zeroGradient for adiabatic wall for example p zeroGradient U fixedValues Good luck, Thomas 
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.53872e06, Final residual = 5.94514e07, 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_7OstreamE0xb34150 in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so" #1 _ZN4Foam6sigFpe13sigFpeHandlerEi0xad1820 in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so" #2 Uninterpreted: [0xa0000000000107e0] #3 _ZNK4Foam13LimitedSchemeIdNS_14vanLeerLimiterINS_6 NVDTVDEEENS_10limitFuncs6magSqrEE7limiterERKNS_14G eometricFieldIdNS_12fvPatchFieldENS_7volMeshEEE0x1d0538e in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/lib/linuxIA64GccDPOpt/libfiniteVolume.so" #4 _ZNK4Foam33limitedSurfaceInterpolationSchemeIdE7we ightsERKNS_14GeometricFieldIdNS_12fvPatchFieldENS_ 7volMeshEEE0x1f1c680 in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/lib/linuxIA64GccDPOpt/libfiniteVolume.so" #5 _ZNK4Foam2fv21gaussConvectionSchemeIdE6fvmDivERKNS _14GeometricFieldIdNS_13fvsPatchFieldENS_11surface MeshEEERNS3_IdNS_12fvPatchFieldENS_7volMeshEEE0x1f192a0 in "/home/g2/e090012/OpenFOAM/OpenFOAM1.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/OpenFOAM1.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/OpenFOAM1.5/applications/bin/linuxIA64GccDPOpt/boussinesqBuoyantSimpleFoam" #8 _ZN4Foam10boussinesq9RASModels8kEpsilon7correctEv0x28bce90 in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/lib/linuxIA64GccDPOpt/libboussinesqRASModels.so" #9 main in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/applications/bin/linuxIA64GccDPOpt/boussinesqBuoyantSimpleFoam" #10 __libc_start_main0x734df0 in "/lib/tls/libc.so.6.1" #11 _start in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/applications/bin/linuxIA64GccDPOpt/boussinesqBuoyantSimpleFoam" Floating exception 
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 
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.26735e05, cumulative = 1.26735e05 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 
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 
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.44868e05, Final residual = 1.07567e07, No Iterations 1 DILUPBiCG: Solving for Uy, Initial residual = 8.85825e05, Final residual = 7.61361e07, No Iterations 1 DILUPBiCG: Solving for Uz, Initial residual = 0.000162127, Final residual = 2.14391e07, No Iterations 1 DICPCG: Solving for p, Initial residual = 5.65597e07, Final residual = 5.65597e07, 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.88982e12, Final residual = 1.88982e12, No Iterations 0 bounding epsilon, min: 7.47085e21 max: 1.23994e+73 average: 3.73395e+67 DILUPBiCG: Solving for k, Initial residual = 3.48683e12, Final residual = 3.48683e12, No Iterations 0 ExecutionTime = 2757.74 s ClockTime = 2762 s Time = 12 DILUPBiCG: Solving for Ux, Initial residual = 1.80298e05, Final residual = 2.57007e08, No Iterations 1 DILUPBiCG: Solving for Uy, Initial residual = 7.42283e05, Final residual = 1.37196e07, No Iterations 1 DILUPBiCG: Solving for Uz, Initial residual = 4.26046e05, Final residual = 8.07066e08, No Iterations 1 DICPCG: Solving for p, Initial residual = 9.44909e07, Final residual = 9.44909e07, 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.88982e12, Final residual = 1.88982e12, No Iterations 0 bounding epsilon, min: 7.47085e21 max: 1.23994e+73 average: 3.73395e+67 DILUPBiCG: Solving for k, Initial residual = 2.35561e12, Final residual = 2.35561e12, No Iterations 0 ExecutionTime = 2816.46 s ClockTime = 2820 s Time = 13 DILUPBiCG: Solving for Ux, Initial residual = 9.76122e06, Final residual = 9.76122e06, No Iterations 0 DILUPBiCG: Solving for Uy, Initial residual = 2.55133e05, Final residual = 6.15858e08, No Iterations 1 DILUPBiCG: Solving for Uz, Initial residual = 2.17068e05, Final residual = 3.06414e08, No Iterations 1 #0 _ZN4Foam5error10printStackERNS_7OstreamE0xb383f0 in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so" #1 _ZN4Foam6sigFpe13sigFpeHandlerEi0xb01820 in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so" #2 Uninterpreted: [0xa0000000000107e0] #3 _ZN4Foam17DICPreconditioner15calcReciprocalDERNS_5 FieldIdEERKNS_9lduMatrixE0xef5f6e in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so" #4 _ZN4Foam17DICPreconditionerC1ERKNS_9lduMatrix6solv erERNS_7IstreamE0xef5a60 in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so" #5 _ZN4Foam9lduMatrix14preconditioner30addsymMatrixCo nstructorToTableINS_17DICPreconditionerEE3NewERKNS 0_6solverERNS_7IstreamE0xeaa6d0 in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so" #6 _ZN4Foam9lduMatrix14preconditioner3NewERKNS0_6solv erERNS_7IstreamE0xf18580 in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so" #7 _ZNK4Foam3PCG5solveERNS_5FieldIdEERKS2_h0xf10a80 in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/lib/linuxIA64GccDPOpt/libOpenFOAM.so" #8 _ZN4Foam8fvMatrixIdE5solveERNS_7IstreamE0x1f46d10 in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/lib/linuxIA64GccDPOpt/libfiniteVolume.so" #9 main in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/applications/bin/linuxIA64GccDPOpt/simpleFoam" #10 __libc_start_main0x739080 in "/lib/tls/libc.so.6.1" #11 _start in "/home/g2/e090012/OpenFOAM/OpenFOAM1.5/applications/bin/linuxIA64GccDPOpt/simpleFoam" Floating exception 
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 
Dear Chiven,
You switched off ALL convection terms: Quote:
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 
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 
Quote:

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 
Quote:
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? 
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 
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, 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 
Quote:
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. 