|
[Sponsors] |
April 12, 2017, 08:49 |
2D nozzle in rhoSimpleFoam
|
#1 |
Member
Jan Surwiło
Join Date: Feb 2017
Posts: 31
Rep Power: 9 |
Hello all,
I'm loosing patient with OF. I'm trying to calculate simple nozzle like in attachment. Inlet at left outlet at right, front and back empty, rest are wall. I use HELYX OS to prepare case. I want to use compressible SST model. At bottom I paste the "0" files. For k Code:
/*--------------------------------*- C++ -*----------------------------------*\ | o | | | o o | HELYX-OS | | o O o | Version: v2.4.0 | | o o | Web: http://www.engys.com | | o | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object k; } dimensions [ 0 2 -2 0 0 0 0 ]; internalField uniform 0.01; boundaryField { frontandback { type empty; } inlet { type turbulentIntensityKineticEnergyInlet; value uniform 0.01; intensity 0.05; } outlet { type turbulentIntensityKineticEnergyInlet; value uniform 0.01; intensity 0.05; } wall { type kqRWallFunction; value uniform 1e-20; } } Code:
/*--------------------------------*- C++ -*----------------------------------*\ | o | | | o o | HELYX-OS | | o O o | Version: v2.4.0 | | o o | Web: http://www.engys.com | | o | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object omega; } dimensions [ 0 0 -1 0 0 0 0 ]; internalField uniform 0.0; boundaryField { frontandback { type empty; } inlet { type turbulentMixingLengthFrequencyInlet; value uniform 0.01; mixingLength 0.1; } outlet { type turbulentMixingLengthFrequencyInlet; value uniform 0.01; mixingLength 0.1; } wall { type omegaWallFunction; value uniform 1; } } Code:
/*--------------------------------*- C++ -*----------------------------------*\ | o | | | o o | HELYX-OS | | o O o | Version: v2.4.0 | | o o | Web: http://www.engys.com | | o | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object p; } dimensions [ 1 -1 -2 0 0 0 0 ]; internalField uniform 100000.0; boundaryField { frontandback { type empty; } inlet { type totalPressure; value uniform 0.0; p0 uniform 300000.0; gamma 1.4; } outlet { type totalPressure; value uniform 0.0; p0 uniform 100000.0; gamma 1.4; } wall { type zeroGradient; } } Code:
/*--------------------------------*- C++ -*----------------------------------*\ | o | | | o o | HELYX-OS | | o O o | Version: v2.4.0 | | o o | Web: http://www.engys.com | | o | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object U; } dimensions [ 0 1 -1 0 0 0 0 ]; internalField uniform (0.0 0.0 0.0); boundaryField { frontandback { type empty; } inlet { type zeroGradient; value uniform ( 0.0 0.0 0.0 ); } outlet { type zeroGradient; value uniform ( 0.0 0.0 0.0 ); } wall { type fixedValue; value uniform ( 0 0 0); } } Code:
****************** * Run Case * ****************** Case : /home/jan/open_test/nozzle Procs : -1 Log : /home/jan/open_test/nozzle/log/rhoSimpleFoam.log Env : /opt/openfoam4/etc/bashrc Vendor : /opt Paraview : MachineFile : Solver : rhoSimpleFoam /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 4.1 Exec : rhoSimpleFoam -case /home/jan/open_test/nozzle Date : Apr 12 2017 Time : 13:29:29 Host : "jan-VirtualBox" PID : 29271 Case : /home/jan/open_test/nozzle nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 SIMPLE: convergence criteria field U tolerance 1e-05 field k tolerance 1e-05 field epsilon tolerance 1e-05 field omega tolerance 1e-05 field nuTilda tolerance 1e-05 field T tolerance 1e-05 field p_rgh tolerance 1e-05 field p tolerance 1e-05 Reading thermophysical properties Selecting thermodynamics package { type hePsiThermo; mixture pureMixture; transport const; thermo hConst; equationOfState perfectGas; specie specie; energy sensibleEnthalpy; } Reading field U Reading/calculating face flux field phi Creating turbulence model Selecting turbulence model type RAS Selecting RAS turbulence model kOmegaSST Selecting patchDistMethod meshWave bounding omega, min: 0 max: 0.01 average: 0 kOmegaSSTCoeffs { label "k-\u03C9 SST"; fieldMaps { k k; omega omega; nut nut; alphat alphatCompressible; } alphaK1 0.85034; alphaK2 1; alphaOmega1 0.5; alphaOmega2 0.85616; gamma1 0.5532; gamma2 0.4403; beta1 0.075; beta2 0.0828; betaStar 0.09; a1 0.31; c1 10; Cmu 0.09; alphah 1.111; b1 1; F3 false; } Creating MRF zone list from MRFProperties Creating finite volume options from "system/fvOptions" #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" #3 Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) at ??:? #4 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator/<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:? #5 Foam::kOmegaSST<Foam::eddyViscosity<Foam::RASModel<Foam::EddyDiffusivity<Foam::ThermalDiffusivity<Foam::CompressibleTurbulenceModel<Foam::fluidThermo> > > > >, Foam::EddyDiffusivity<Foam::ThermalDiffusivity<Foam::CompressibleTurbulenceModel<Foam::fluidThermo> > > >::F2() const at ??:? #6 Foam::kOmegaSST<Foam::eddyViscosity<Foam::RASModel<Foam::EddyDiffusivity<Foam::ThermalDiffusivity<Foam::CompressibleTurbulenceModel<Foam::fluidThermo> > > > >, Foam::EddyDiffusivity<Foam::ThermalDiffusivity<Foam::CompressibleTurbulenceModel<Foam::fluidThermo> > > >::F23() const at ??:? #7 Foam::kOmegaSST<Foam::eddyViscosity<Foam::RASModel<Foam::EddyDiffusivity<Foam::ThermalDiffusivity<Foam::CompressibleTurbulenceModel<Foam::fluidThermo> > > > >, Foam::EddyDiffusivity<Foam::ThermalDiffusivity<Foam::CompressibleTurbulenceModel<Foam::fluidThermo> > > >::correctNut() at ??:? #8 ? at ??:? #9 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #10 ? at ??:? /home/jan/open_test/nozzle/solver_serial.run: line 32: 29271 Floating point exception(core dumped) $SOLVER -case $CASE 2>&1 29272 Done | tee -a $LOG Please help me because I'm sick of OF right now. |
|
April 13, 2017, 12:52 |
|
#2 |
Senior Member
Join Date: Nov 2010
Location: USA
Posts: 1,232
Rep Power: 25 |
Your boundary conditions don't make any sense. Why do k and omega have inlet conditions specified for the outlet? Is it really reasonable to initialize omega as zero everywhere?
From the error the problem is clearly in the turbulence model. Have you tried disabling it and seeing if the case runs to check if everything else is OK? Does it make sense to specify total pressure on the inlet and outlet? I think it only makes sense to do so on the inlet. The outlet should be a static pressure. |
|
April 14, 2017, 04:01 |
|
#3 |
Member
Jan Surwiło
Join Date: Feb 2017
Posts: 31
Rep Power: 9 |
Thank you for your respond.
I tried lamina flow which worked fine, even Spalart-Allamaras seams to be stable and give good results. But for k-epsilon and SST it is very hard to run calculation. It usually collapsed after few iteration. In previous post is only an example of of BC. As you said I tried total pressure at inlet and fixedValue at outlet for velocity both was zeroGradient. Is it good to use zeroGradient for velocity with totalPressure? Or should I use pressureInletVelocity? I also tried different initialization. I affect in one or few iteration more but no more than six to seven. I changed mesh for hexa and tried calculation by rhoPimpleFoam with adaptive deltaT and courant number < 0.8. It also collapsed but give results (find in attachment). How to initialize k and omega while it has very different value in different place in model? The nozzle is very simple model, I can't image problem with more complex one with multiple inlet and outlet. I'm new in FOAM I used to work with fluent. One more question, I use openFOAM on virtualBox Ubuntu. Could it produce errors in calculation? |
|
April 14, 2017, 10:34 |
|
#4 |
Member
Jan Surwiło
Join Date: Feb 2017
Posts: 31
Rep Power: 9 |
Ok, i manage to run with different boundary condition. I used fixed velocity at inlet. With totalPressure it didn't work.
U Code:
/*--------------------------------*- C++ -*----------------------------------*\ | o | | | o o | HELYX-OS | | o O o | Version: v2.4.0 | | o o | Web: http://www.engys.com | | o | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object U; } dimensions [ 0 1 -1 0 0 0 0 ]; internalField uniform (0.0 0.0 0.0); boundaryField { front { type empty; } inlet { type fixedValue; value uniform ( 5.0 0.0 0.0 ); } outlet { type pressureInletOutletVelocity; value uniform ( 0 0 0); } wall { type fixedValue; value uniform ( 0 0 0); } back { type empty; } } Code:
/*--------------------------------*- C++ -*----------------------------------*\ | o | | | o o | HELYX-OS | | o O o | Version: v2.4.0 | | o o | Web: http://www.engys.com | | o | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object p; } dimensions [ 1 -1 -2 0 0 0 0 ]; internalField uniform 100000.0; boundaryField { front { type empty; } inlet { type zeroGradient; } outlet { type totalPressure; p0 uniform 100000.0; value uniform 1e5; rho rho; psi none; U U; phi phi; gamma 1.0; } wall { type zeroGradient; } back { type empty; } } Code:
/*--------------------------------*- C++ -*----------------------------------*\ | o | | | o o | HELYX-OS | | o O o | Version: v2.4.0 | | o o | Web: http://www.engys.com | | o | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object k; } dimensions [ 0 2 -2 0 0 0 0 ]; internalField uniform 0.3; boundaryField { front { type empty; } inlet { type fixedValue; value uniform 0.3; } outlet { type inletOutlet; value uniform 0.1; inletValue uniform 2.0; } wall { type kqRWallFunction; value uniform 1e-20; } back { type empty; } } Code:
/*--------------------------------*- C++ -*----------------------------------*\ | o | | | o o | HELYX-OS | | o O o | Version: v2.4.0 | | o o | Web: http://www.engys.com | | o | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object omega; } dimensions [ 0 0 -1 0 0 0 0 ]; internalField uniform 78.9; boundaryField { front { type empty; } inlet { type fixedValue; value uniform 78.9; } outlet { type inletOutlet; value uniform 0.1; inletValue uniform 100.0; } wall { type omegaWallFunction; value uniform 1; } back { type empty; } } https://www.cfd-online.com/Wiki/Turb...ary_conditions but with the same strategy for different inlet velocity the problem with starting occurred again. It is impossible to run calculation. How can I estimate the value for k and omega as I don't know anything about outlet condition? And how to estimate initial value? By the way in fluent it almost doesn't matter what initial value you set. It usually works perfect for initialize all with 0 values. Why openFOAM is so sensitive for initialization? me3840 What boundary condition will you suggest for this calculation? |
|
April 14, 2017, 11:03 |
|
#5 |
Senior Member
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15 |
I don't understand which physical reality you want to cover with your rather complicated initiat conditions for k and . Why don't you use constant value at the inlet and in the field and zero gradient in the outlet region? Why do you set the whole outlet plane to a constant pressure?
__________________
Uwe Pilz -- Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950) |
|
April 14, 2017, 11:36 |
|
#6 | |||
Senior Member
Join Date: Nov 2010
Location: USA
Posts: 1,232
Rep Power: 25 |
Quote:
It looks like you did that yourself already. Quote:
In reality many flows do not see great changes from changes in turbulence initial conditions, OpenFOAM doesn't change that. We have not established that OpenFOAM is being sensitive to these values, there can be lots of other things wrong with your simulation. Just because something 'works' in another code doesn't make it right. The whole point of an initial solution is to be somewhat close to the final one. Making everything 0 everywhere just makes your life harder, but it probably won't change the answer if the model converges. Quote:
rhoSimpleFoam is not very stable for these kinds of simulations in the first place. You will probably have to start with low pressure ratios and work your way up. This may only be runnable with a transient solver, or rhoCentralFoam. |
||||
April 20, 2017, 04:04 |
|
#7 | ||
Member
Jan Surwiło
Join Date: Feb 2017
Posts: 31
Rep Power: 9 |
Thank you all for respond.
Quote:
Quote:
|
|||
May 9, 2017, 03:39 |
|
#8 |
Member
Giovanni Caramia
Join Date: Mar 2009
Location: Bari, ITALY
Posts: 58
Rep Power: 17 |
I think the last post of this thread could help.
|
|
May 9, 2017, 03:55 |
|
#9 | |
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,290
Rep Power: 34 |
Quote:
So as long as it does not work in openfoam it is right and when it would work in openfoam (after lots of efforts), are you saying that it is not necessarily be going to be right? (since now it works) |
||
May 9, 2017, 09:24 |
|
#10 |
Member
power
Join Date: Jun 2014
Posts: 86
Rep Power: 12 |
Hi all,
I have the same problem with rhoSimpleFoam using OpenFoam and not Helyx. I described my case here Surely your case will generally work also for me @johny0688 Could you share the working boundary conditions you set to start your simulation. Thanks |
|
May 9, 2017, 09:29 |
|
#11 | ||
Member
Jan Surwiło
Join Date: Feb 2017
Posts: 31
Rep Power: 9 |
karamiag
Thank you for good advice. Now I'm further with simulation, I'm calculating different model (I don't have access to computer at work, when I do I will paste the pictures). I manage to increase the velocity and pressure at BC during the calculation by table depends on time. I also initialize domain with different values by setFieldsDict. I realized that after some timesteps the temperature grows to enormous value. By analyzing step by step I found that it occurred wherever inside the domain even if the flow is very slow. So I bounded the temperature in fvOptions. Now the case works but only with rhoPimpleFoam (transient). Still the Courant number is very high over 3 with timeStep 2e-8 so the simulation take very long to reaches steady flow. At the end of this week I will try to run case with rhoSimpleFoam including yours advice. Will find out if it helps Quote:
Quote:
I will post all my cases when I get acces to computer at work. All the best, |
|||
May 9, 2017, 14:21 |
|
#12 | |
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,290
Rep Power: 34 |
Quote:
I have seen openFOAM's code too and it is nowhere near in terms of following things for accuracy. I carried the same attitude for FVUS, that is accuracy first, then stability and it has to be stable for industrial cases. PS: Samir muzaferija once told me that let the solver diverge and then user fix the mesh then to give it stable and inaccurate results. This he said when i was showing him how I can make a very difficult case stable that has near zero or negative cell volumes. He also said that lot of money riding on it so inaccurate results are big No No. |
||
Tags |
nozzle, rhosimplefoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
transsonic nozzle with rhoSimpleFoam | Unseen | OpenFOAM Running, Solving & CFD | 8 | July 1, 2022 07:54 |
compressible, rhoSimpleFoam, multi-species, steady state, rocket nozzle | David_C | OpenFOAM Running, Solving & CFD | 1 | April 18, 2017 12:01 |
Problem in temperature profiles while using rhoSimpleFoam for Nozzle case | Nik_04 | OpenFOAM Running, Solving & CFD | 0 | February 4, 2017 06:04 |
Nozzle rhoSimpleFoam transonic --> time step increase | erichu | OpenFOAM Running, Solving & CFD | 2 | May 3, 2013 13:54 |
compressible flow in a counterflow nozzle | d.vamsidhar | FLUENT | 0 | November 24, 2005 02:45 |