CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Boundary Conditions for Internal compressible Flow (https://www.cfd-online.com/Forums/openfoam-pre-processing/70246-boundary-conditions-internal-compressible-flow.html)

xisto November 18, 2009 07:33

Boundary Conditions for Internal compressible Flow
 
Hello all,

First of all i am a newbie in OpenFOAM

I' m trying to simulate a compressible flow in a duct with a bump using laminar rhoPisoFoam.

I used Fluent to verify the case. In Fluent i used for bc's Presure inlet (total pressure and tempreture) and pressure Outlet (static pressure).

Now i want to reply these bc's in Foam, but i dont no how.

I'am trying with these, please tell me if i'm rigth.

FOR PRESSURE:
internalField uniform 126453;
boundaryField
{
sidewalls
{
type zeroGradient;
}

up_wall
{
type zeroGradient;
}

low_wall
{
type zeroGradient;
}
inlet
{
type totalPressure;
p0 uniform 150000;

gamma 1.4;
value uniform 150000;
}
outlet
{
type fixedValue;
value uniform 126453;
}

}

FOR VELOCITY

internalField uniform (0 0 0);

boundaryField
{
sidewalls
{
type zeroGradient;
}

up_wall
{
type zeroGradient;
}
low_wall
{
type zeroGradient;
}
inlet
{

type zeroGradient;

}

outlet
{

type zeroGradient;

}

}

FOR TEMPERATURE
dimensions [0 0 0 1 0 0 0];

internalField uniform 300;

boundaryField
{
sidewalls
{
type zeroGradient;
}

up_wall
{
type zeroGradient;
}
low_wall
{
type zeroGradient;
}
inlet
{
type fixedValue;
value uniform 300;
}
outlet
{

type inletOutlet;
inletValue uniform 300;

}
}

Thanks in advance

CX

xisto November 18, 2009 07:36

The controlDict file:

application rhoPisoFoam;

startFrom startTime;

startTime 0;

stopAt endTime;

endTime 2;

deltaT 0.00001;

writeControl runTime;

writeInterval 0.1;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression uncompressed;

timeFormat general;

timePrecision 6;

runTimeModifiable yes;

adjustTimeStep no;

maxCo ;

maxDeltaT 1;

xisto November 21, 2009 06:46

Anyone???

CX

xisto December 3, 2009 20:47

Ok..

I used Total pressure for inlet with psi = psi (compressible flow).

For velocity at inlet i used presureDirectedVelocityInlet were i give a value for the inlet direction, and a value for intial velocity at the inlet.

I impose also total temprature..

For the outlet i specify a static pressure, and zeroGradient for all other variables.

Works fine..:D

Carlos Xisto

mhmt January 30, 2010 18:06

Carlos, may I ask you to share your 0/ p U T files ?

Regards,

Mehmet

xisto January 30, 2010 19:16

1 Attachment(s)
These one are for the transonic case (works in the subsonic also).

For the supersonic you need to specify all variables at inlet (fixed values for temperature (static), pressure (static) and velocity). Extrapolate all variables from outlet (zero gradient).

mhmt February 1, 2010 08:24

Thanks for the files.

I will also simulate a transonic flow but with a steady solver (rhoSimpleFoam). Tried to copy your files.. but it is asking for U, phi for the total pressure inlet boundary and U,phi and psi for the total temperature inlet boundary. I tried also with the required information for U,psi and phi but unfortunately it is not working again.

Can I learn which version of Openfoam you are using?

Regards.

xisto February 1, 2010 08:40

Ok first of all I'm new at openFoam...

I'm using 1.6

Can you post the shell information here?

Cheers,

CX

mhmt February 1, 2010 10:01

3 Attachment(s)
Thanks for your quick answer Carlos.

I am using Openfoam 1.5 and here are my files ;

I also tried with the 1.6 version; then appears an error with the thermophysical properties. It crashes in a few iterations when I run laminar. I am sure that the problem is not the mesh, because I am just runnuing the code for a test case with a simple rectangular 2D geometry. Any comment is much appreciated..

Regards

xisto February 1, 2010 11:23

Ok.

I notice an error in your thermophysicalProperties dictionary.

You specify that you are using the Sutherland transport in the transport properties and then you input the values for the constTransport.

In the termophysical model you specify hThermo, I'm not familiarized with the 1.5, but in the 1.6 I used hPsiThermo - calculation based on h and psi. (I don't now if that patch even exist in the 1.5 version).

As you can see in my 0 files I don't need to specify phi and U. If you send me the error that appear in your shell. Maybe I can help... otherwise..

Cheers,

CX

mhmt February 1, 2010 12:48

As you have suggested, I used hPsiThermo model for the version 1.6.

thermoType hPsiThermo<pureMixture<sutherlandTransport<specieT hermo<hConstThermo<perfectGas>>>>>;
mixture air 1 28.9 1007 0 1.4792e-06 116;

Here is the error message.

Time = 0.5

smoothSolver: Solving for Ux, Initial residual = 0.232175, Final residual = 0.0183628, No Iterations 4
smoothSolver: Solving for Uy, Initial residual = 0.20495, Final residual = 0.0115015, No Iterations 6
DILUPBiCG: Solving for h, Initial residual = 0.304703, Final residual = 0.00124444, No Iterations 2
GAMG: Solving for p, Initial residual = 0.983346, Final residual = 7.43012e-09, No Iterations 15
time step continuity errors : sum local = 0.000107626, global = -5.18031e-05, cumulative = -5.20557e-05
rho max/min : 32.9887 1.27449
ExecutionTime = 12.9 s ClockTime = 13 s

Time = 0.6

smoothSolver: Solving for Ux, Initial residual = 0.283681, Final residual = 0.0173673, No Iterations 4
smoothSolver: Solving for Uy, Initial residual = 0.38148, Final residual = 0.0216, No Iterations 6
DILUPBiCG: Solving for h, Initial residual = 0.395197, Final residual = 0.0152132, No Iterations 1
#0 Foam::error::printStack(Foam::Ostream&) in "/software/oss/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::sigFpe::sigFpeHandler(int) in "/software/oss/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 __restore_rt at sigaction.c:0
#3 Foam::hPsiThermo<Foam::pureMixture<Foam::sutherlan dTransport<Foam::specieThermo<Foam::hConstThermo<F oam::perfectGas> > > > >::calculate() in "/software/oss/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libbasicThermophysicalModels.so"
#4 Foam::hPsiThermo<Foam::pureMixture<Foam::sutherlan dTransport<Foam::specieThermo<Foam::hConstThermo<F oam::perfectGas> > > > >::correct() in "/software/oss/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libbasicThermophysicalModels.so"
#5 main in "/software/oss/OpenFOAM/OpenFOAM-1.6/applications/bin/linux64GccDPOpt/rhoSimpleFoam"
#6 __libc_start_main in "/lib64/libc.so.6"
#7 _start at /usr/src/packages/BUILD/glibc-2.9/csu/../sysdeps/x86_64/elf/start.S:116
Floating point exception

Regards.

xisto February 1, 2010 13:14

Why do you use a deltaT=0.1 - the rhoSimpleFoam is a steady state solver.

Try deltaT=1..

CX

mhmt February 1, 2010 14:16

Changing the time step does not work unfortunately. I tried many variations for delta T.

With version 1.5, I have suceeded to run the code but the residuals are unacceptably big.


Time = 99

smoothSolver: Solving for Ux, Initial residual = 0.0108103, Final residual = 0.000975499, No Iterations 4
smoothSolver: Solving for Uy, Initial residual = 0.0274258, Final residual = 0.00263698, No Iterations 2
DILUPBiCG: Solving for h, Initial residual = 0.0152814, Final residual = 0.000172995, No Iterations 1
GAMG: Solving for p, Initial residual = 0.733572, Final residual = 3.61836e-09, No Iterations 13
time step continuity errors : sum local = 9.54107e-08, global = 3.18967e-08, cumulative = 8.01901e-07
rho max/min : 1.67032 1.35875
smoothSolver: Solving for epsilon, Initial residual = 0.00824669, Final residual = 0.000471946, No Iterations 2
smoothSolver: Solving for k, Initial residual = 0.0100756, Final residual = 0.000737614, No Iterations 2

Time = 100

smoothSolver: Solving for Ux, Initial residual = 0.0105662, Final residual = 0.00099737, No Iterations 4
smoothSolver: Solving for Uy, Initial residual = 0.0252288, Final residual = 0.000761451, No Iterations 4
DILUPBiCG: Solving for h, Initial residual = 0.0152109, Final residual = 0.000173026, No Iterations 1
GAMG: Solving for p, Initial residual = 0.735529, Final residual = 3.86563e-09, No Iterations 13
time step continuity errors : sum local = 1.02277e-07, global = 4.39179e-08, cumulative = 8.45819e-07
rho max/min : 1.66991 1.35852
smoothSolver: Solving for epsilon, Initial residual = 0.00844277, Final residual = 0.000502872, No Iterations 2
smoothSolver: Solving for k, Initial residual = 0.0101629, Final residual = 0.000767375, No Iterations 2


My BC should be allright because it is proved to be working on your case. I think I have a problem with the settings in fvSchemes. Increasing the number of correctors of the SIMPLE scheme is getting the residuals a bit lower, but not so much.

Regards

xisto February 1, 2010 17:00

the transonic case is a bit hard to solve.

In your fvSchemes you used for the divSchemes - upwind (in my case the residuals get stuck as well with the upwind)

Check mine:

With Gauss linear in the divSchemes works as well, but it perform better with the Gamma.



ddtSchemes
{
default Euler;
}

gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
}

divSchemes
{
default none;
div(phi,U) Gauss GammaV 1;
div(phid,p) Gauss Gamma 1;
div(phiU,p) Gauss Gamma 1;
div(phi,h) Gauss Gamma 1;
div(phi,k) Gauss Gamma 1;
div(phi,epsilon) Gauss Gamma 1;
div(phi,R) Gauss Gamma 1;
div(phi,omega) Gauss Gamma 1;
div((rho*R)) Gauss linear;
div(R) Gauss linear;
div(U) Gauss Gamma 1;
div((muEff*dev2(grad(U).T()))) Gauss linear;
}

laplacianSchemes
{
default none;
laplacian(muEff,U) Gauss linear corrected;
laplacian(mut,U) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected;
laplacian(DepsilonEff,epsilon) Gauss linear corrected;
laplacian(DREff,R) Gauss linear corrected;
laplacian(DomegaEff,omega) Gauss linear corrected;
laplacian((rho*(1|A(U))),p) Gauss linear corrected;
laplacian(alphaEff,h) Gauss linear corrected;
}

interpolationSchemes
{
default linear;
}

snGradSchemes
{
default corrected;
}

fluxRequired
{
default no;
p ;
}

mhmt February 4, 2010 13:30

Hi Carlos.

Whatever I do, I could not get any reasonable results. I start thinking about that the rhoSimpleFoam solver may not be stable for transonic calculations. So, if you can e-mail me your own case, I would like to try it first with a transient solver (which is proved to be working) and than rhoSimpleFoam. If you can upload also the mesh, it would be better, so I can be sure that I am not doing any mistakes.
My e-mail:mehmetkaya84@gmail.com...Thanks for your efforts.

Regards.

xisto February 4, 2010 17:22

2 Attachment(s)
Ok Mehmet I will mail it to you.

But mine is a 3D inviscid Case.

Open the grid with ParaFoam, the direction of the flow is z.

And I used rhoPisoFoam works fine, check the results.

regards and best luck

CX

gaz February 18, 2010 19:42

compressible flow
 
Hi all
First of all I am a new user to ANSYS 12. I want to use fluent with compessible flow in side nozzle with heigh speed could you help me please.
Regards
Gaz

xisto February 19, 2010 11:59

Hi gaz,

My advice is for you to try some of FLUENT tutorials available in the web.

Check this website.

http://courses.cit.cornell.edu/fluent/

Good Luck

CX

PS: This is a forum reserved for openFoam, if you have more doubts check the FLUENT forum.

vwibaut November 27, 2012 08:54

Need help
 
Hi all :)

I would like to simulate a supersonic nozzle with and without shock. So I have the same boundary conditions of Xisto except for the pressure at the outlet. I use waveTransmissive to avoid the reflection of the wave.
Is it ok?

Other question: When I use waveTransmissive I have to choose a "linf". But how do I choose the value?

immortality February 27, 2013 13:24

what George?
what schemes there are for div(U)?


All times are GMT -4. The time now is 21:57.