|
[Sponsors] |
July 26, 2010, 12:25 |
simpleFoam - flow around a cube
|
#1 |
New Member
Benni
Join Date: May 2010
Posts: 12
Rep Power: 16 |
Hello,
I try to simulate the flow around a cube in a 3D-channel with simpleFoam for incompessible flow, steady state. set up: inlet and outlet: cyclic front and back of the channel: symmetryPlane top and bottom of the channel: wall with increasing iterations the streamwise velocity decreases. because of this the massflow is decreasing, too, I think (inkompressible steady state flow)?!? How can I implement a constant mass flow in simpleFoam. Thanks Benni |
|
July 27, 2010, 03:27 |
simpleFoam - flow around a cube
|
#2 |
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18 |
Hi Benni
Your problem is ill conditioned mathematically (has no unique solution in steady state). I think you can use a velocity inlet boundary condition and a value of pressure at outlet. Good luck Best regards Ata |
|
July 27, 2010, 03:33 |
simpleFoam - flow around a cube
|
#3 |
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18 |
Hi Benni
Your problem is ill conditioned mathematically (has no unique solution in steady state). I think you can use a velocity inlet boundary condition and a value of pressure at outlet. Good luck Best regards Ata |
|
July 27, 2010, 04:09 |
|
#4 |
New Member
Benni
Join Date: May 2010
Posts: 12
Rep Power: 16 |
Hi Ata,
thanks for your answer. But I need cyclic inlet outlet boundary conditions, so I can simulate an array of cubes. For only one cube I tried velocity inlet BC and a pressure BC at the outlet. It works better. But I`m interested in a constant mass flow for simple foam?! Thanks Benni |
|
July 27, 2010, 04:49 |
|
#5 |
Senior Member
Stefan Herbert
Join Date: Dec 2009
Location: Darmstadt, Germany
Posts: 129
Rep Power: 17 |
Hi Benni,
I think what Ata wanted to say is that you must not use cyclic boundary conditions in your case. Just imagine what will happen to your pressure. When you force it to be equal on inlet and outlet, you suppress pressure loss. But without pressure loss, there can be no flow! Two ways to solve it:
Regards, Stefan |
|
July 27, 2010, 06:22 |
|
#6 |
New Member
Benni
Join Date: May 2010
Posts: 12
Rep Power: 16 |
Hi Stefan,
thanks a lot. now I unterstand the problem. I will try it directly best regards Benni |
|
July 27, 2010, 12:22 |
|
#7 |
New Member
Benni
Join Date: May 2010
Posts: 12
Rep Power: 16 |
Hi Stefan,
I tried to modify my solver: I found more information here: http://www.cfd-online.com/Forums/ope...implefoam.html UEqn.H // Solve the Momentum equation tmp<fvVectorMatrix> UEqn ( fvm::div(phi, U) + turbulence->divDevReff(U) == flowDirection*gradP ); UEqn().relax(); eqnResidual = solve ( UEqn() == -fvc::grad(p) ).initialResidual(); maxResidual = max(eqnResidual, maxResidual); pEqn.H: p.boundaryField().updateCoeffs(); volScalarField AU = UEqn().A(); volScalarField rUA = 1.0/UEqn().A(); U = UEqn().H()/AU; //UEqn.clear(); phi = fvc::interpolate(U) & mesh.Sf(); adjustPhi(phi, U, p); // Non-orthogonal pressure corrector loop for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn ( fvm::laplacian(1.0/AU, p) == fvc::div(phi) ); pEqn.setReference(pRefCell, pRefValue); // retain the residual from the first iteration if (nonOrth == 0) { eqnResidual = pEqn.solve().initialResidual(); maxResidual = max(eqnResidual, maxResidual); } else { pEqn.solve(); } if (nonOrth == nNonOrthCorr) { phi -= pEqn.flux(); } } # include "continuityErrs.H" // Explicitly relax pressure for momentum corrector p.relax(); // Momentum corrector U -= fvc::grad(p)/AU; U.correctBoundaryConditions(); // 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()); //volScalarField rUA = 1.0/UEqn.A(); U += flowDirection*rUA*gragPplus; gradP += gragPplus; Info<< "Uncorrected Ubar = " << magUbarStar.value() << tab << "pressure gradient = " << gradP.value() << endl; Its working, but uncorrected Ubar is osszilating around Ubar (defined in transportProperties). pressure gradient is increasing, too. so I get no convergence. And I have some problems with directMapped BC: boundary: /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.7.0 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object changeDictionaryDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dictionaryReplacement { boundary { inlet { type directMappedPatch; sampleMode nearestPatchFace; offset (0 0 0); samplePatch outlet; //sampleRegion region0; //samplePatch none; } } } // ************************************************** *********************** // error message: ggert@linux33:~/OpenFOAM/eggert-1.7.0/run/directMapped_test2$ simpleFoam /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.7.0 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 1.7.0-21131bcbd876 Exec : simpleFoam Date : Jul 27 2010 Time : 17:04:45 Host : linux33 PID : 25270 Case : /home/eggert/OpenFOAM/eggert-1.7.0/run/directMapped_test2 nProcs : 1 SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 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 #0 Foam::error:rintStack(Foam::Ostream&) in "/software/OpenFOAM/OpenFOAM-1.7.0/lib/linuxGccDPOpt/libOpenFOAM.so" #1 Foam::sigFpe::sigFpeHandler(int) in "/software/OpenFOAM/OpenFOAM-1.7.0/lib/linuxGccDPOpt/libOpenFOAM.so" #2 Uninterpreted: #3 Foam::directMappedFixedValueFvPatchField<double>:: updateCoeffs() in "/software/OpenFOAM/OpenFOAM-1.7.0/lib/linuxGccDPOpt/libfiniteVolume.so" #4 Foam::fvPatchField<double>::evaluate(Foam::Pstream ::commsTypes) in "/software/OpenFOAM/OpenFOAM-1.7.0/applications/bin/linuxGccDPOpt/simpleFoam" #5 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::evaluate() in "/software/OpenFOAM/OpenFOAM-1.7.0/applications/bin/linuxGccDPOpt/simpleFoam" #6 Foam::incompressible::RASModels::kEpsilon::kEpsilo n(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&) in "/software/OpenFOAM/OpenFOAM-1.7.0/lib/linuxGccDPOpt/libincompressibleRASModels.so" #7 Foam::incompressible::RASModel::adddictionaryConst ructorToTable<Foam::incompressible::RASModels::kEp silon>::New(Foam::GeometricField<Foam::Vector<doub le>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&) in "/software/OpenFOAM/OpenFOAM-1.7.0/lib/linuxGccDPOpt/libincompressibleRASModels.so" #8 Foam::incompressible::RASModel::New(Foam::Geometri cField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&) in "/software/OpenFOAM/OpenFOAM-1.7.0/lib/linuxGccDPOpt/libincompressibleRASModels.so" Any ideas? Thanks Benni |
|
July 28, 2010, 07:54 |
|
#8 |
Member
|
Hi everyone,
I'm trying to simulate a turbulent flow around the cube. I use a simpleFoam, but have a strange results: stream lines look like laminar flow. But it is impossible, because inlet velocity is 15 m/s. How can it be? |
|
July 28, 2010, 08:00 |
Re number
|
#9 |
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18 |
Hi Arina
As you know laminar or turbulent flow is charaterized by Re number. So, how much is your Re number? If you are sure that your case is turbulent please explain more about your case, solver, turbulence model and boundary conditions. Good luck Best regards Ata |
|
July 28, 2010, 09:07 |
|
#10 | |
Member
|
Quote:
My Re is about 5 000. I use solver simpleFoam-ras, Boundary conditions are: inlet - fixedvalue of all parameters, outlet - zerogradient; box - fixedvalue of velocity and pressure, and walls of chanel - zerogradient |
||
July 28, 2010, 09:43 |
simpleFoam - flow around a cube
|
#11 |
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18 |
Hi Arina
Would you please upload some pictures from your geometry and mesh and your setup files? How much are your residuals? Good luck Best regards Ata |
|
July 28, 2010, 09:55 |
|
#12 |
Member
|
||
July 29, 2010, 02:14 |
simpleFoam - flow around a cube
|
#13 |
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18 |
Hi Arina
I mean "0", "system" and "constant" files. Is your mesh a 3D one? If it is, it seems that in Y direction you have not enough cells. Would you please upload some pictures from your "strange results"? And how much are your residuals? Best regards Good luck Ata |
|
July 29, 2010, 05:54 |
|
#14 | |
Member
|
Quote:
My mesh is a 3D. Why do you think that in Y dir. I haven't enought cells? Result: you can see, that I have a nonseparated flow Here are 0,system,constant http://letitbit.net/download/11314.11ecf6215667cd89018cd6f5f/box.zip.html Last edited by Akuji; July 29, 2010 at 06:21. |
||
July 29, 2010, 07:03 |
|
#15 |
Senior Member
Stefan Herbert
Join Date: Dec 2009
Location: Darmstadt, Germany
Posts: 129
Rep Power: 17 |
Hi Benni,
for your first problem you can try two things:
Regards, Stefan |
|
July 29, 2010, 14:54 |
simpleFoam - flow around a cube
|
#16 |
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18 |
Hi Arina
I think that cube affects boundary conditions in Y direction if this boundaries are near the cube. So, you can not assign a fixed value to these boundaries. I can't download your files. Would you please upload them in an other place such as forshared? In my opinion from your figure it is not clear that flow does not separated. Good luck Best regards Ata |
|
July 31, 2010, 16:27 |
|
#17 |
Member
|
Hi ata
Thanks a lot, I found problem and solved it Last edited by Akuji; August 3, 2010 at 04:19. |
|
August 3, 2010, 04:50 |
|
#18 |
New Member
Benni
Join Date: May 2010
Posts: 12
Rep Power: 16 |
Hi Stefan,
I already added underelaxation for grad p. Have still problems. how do I have to set the BC for k and epsilon when I use directMapped. if k (or epsilon) is not fixedValue I get the failure message (see above). Regards Benni |
|
August 4, 2010, 03:07 |
|
#19 |
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18 |
||
August 4, 2010, 13:35 |
|
#20 | |
Member
|
Quote:
About boundary condition: at inlet I have fixed value, at box and bottom of canal I have velocity = 0 and fixed value of pressure (as I remember). At another region I put zero gradient. So, at result I saw a turbulence whirlwind after box. That is what I want to see) |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Flow meter Design | CD adapco Group Marketing | Siemens | 3 | June 21, 2011 09:33 |
swirling flow in simpleFoam compared with FLUENT | belinda | OpenFOAM Running, Solving & CFD | 0 | November 2, 2009 04:57 |
Steady incompressible laminar flow using simpleFoam | yongshenglian | OpenFOAM Running, Solving & CFD | 0 | October 29, 2008 16:28 |
transform navier-stokes eq. to euler-eq. | pxyz | Main CFD Forum | 37 | July 7, 2006 09:42 |
SimpleFoam pipe flow velocity blowup | gzink | OpenFOAM Running, Solving & CFD | 0 | June 9, 2006 17:52 |