CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Boundary Conditions in rhoSimplecFoam (http://www.cfd-online.com/Forums/openfoam-solving/96294-boundary-conditions-rhosimplecfoam.html)

rawe666 January 18, 2012 12:22

Boundary Conditions in rhoSimplecFoam
 
1 Attachment(s)
Hello friends,
I am trying to make a turbulent flow simulation with using rhoSimplecFoam ver. OpenFOAM-2.1.0. When I run my case after 12 iteration I get an error message. After spending lots of time and many attempts I decided to open a tread in forum. Could someone help me where is the mistake in my boundary conditions? If someone corrects my BCs, that tread can be an example for other foamers.

Inlet
P : totalPressure
U : pressureDirectedInletVelocity
T : fixedValue
k : fixedValue
mut : fixedValue
epsilon : compressible::turbulentMixingLengthDissipationRate Inlet
alphat : fixedValue

Outlet
P : fixedValue
U : zeroGradient
T : fixedValue
k :zeroGradient
mut : zeroGradient
epsilon : fixedValue
alphat : fixedValue

FixedWalls
P : zeroGradient
U : fixedValue (0 0 0)
T : zeroGradient
k : compressible::kqRWallFunction
mut : mutkWallFunction
epsilon : compressible::epsilonWallFunction
alphat : alphatWallFunction

Left
cyclic

Right
cyclic


I do not know exact outlet pressure. But I can make a good guess for it. My velocities are low and at the outlet they must be slower than the inlet. I can guess it from the formula of total pressure.

Thanks in advance!
Regards
Gökhan

pcaste12 March 5, 2012 11:47

Hi Gökha,
I don't if I could help but what kind of error did you get?
Pierre.

rawe666 March 13, 2012 10:40

Hi Pierre,

I played with the relaxation factors and now I am able to run the simulation but results are not like what I expected. Thats why I changed boundaries again like the following lines;

for the velocity -- used fixedValue at the inlet, zeroGradient at the outlet.
for the pressure -- used zeroGradient at inlet, total pressure at the outlet.
With lower relaxation values.

It works fine and convergence is fast. But I have a small doubt regarding rho. It seems to be constant. Now trying to understand rho file.

samsi March 15, 2012 03:28

Hi,
check the 0/fvsolution file. There is the possibility to enter a rhoMin and rhoMax value. Have you set them to a realistic value for your case?

SIMPLE
{
nNonOrthogonalCorrectors 0;
rhoMin rhoMin [1 -3 0 0 0] 0.8;
rhoMax rhoMax [1 -3 0 0 0] 1.4;
transonic yes;

rawe666 March 15, 2012 12:10

Hi samsi,

you solved my problem. Somehow, I used values 0.1 and 1 which are out of my density range. Now I changed the interval and I am able to see that rho is not constant anymore. Thanks!

buaawangwei April 4, 2012 04:13

Hi samsi,
can you explain the "transonic yes"?
Thank you

samsi April 4, 2012 07:07

Hello,
sorry i can't give you an explanation for this... maybe someone else can do this... ?

Tobi May 15, 2012 10:51

Hi,

i am not sure if its actuall but the transonic option is a switch in the equation of the pEqn.H file:

if transonic true;

Code:

    {
        surfaceScalarField phid
        (
            "phid",
            fvc::interpolate(psi*U) & mesh.Sf()
        );

        surfaceScalarField phic
        (
            "phic",
            fvc::interpolate(rho/AtU - rho/AU)*fvc::snGrad(p)*mesh.magSf()
          + phid*(fvc::interpolate(p) - fvc::interpolate(p, "UD"))
        );

        //refCast<mixedFvPatchScalarField>(p.boundaryField()[1]).refValue()
        //    = p.boundaryField()[1];

        fvScalarMatrix pEqn
        (
            fvm::div(phid, p)
          + fvc::div(phic)
          - fvm::Sp(fvc::div(phid), p)
          + fvc::div(phid)*p
          - fvm::laplacian(rho/AtU, p)
        );
        //pEqn.relax();

        pEqn.setReference(pRefCell, pRefValue);

        pEqn.solve();

        if (simple.finalNonOrthogonalIter())
        {
            phi == phic + pEqn.flux();
        }
    }

if transonic false;
Code:

        phi = fvc::interpolate(rho*U) & mesh.Sf();
        closedVolume = adjustPhi(phi, U, p);
        phi += fvc::interpolate(rho/AtU - rho/AU)*fvc::snGrad(p)*mesh.magSf();

        fvScalarMatrix pEqn
        (
            fvc::div(phi)
        //- fvm::laplacian(rho/AU, p)
          - fvm::laplacian(rho/AtU, p)
        );

        pEqn.setReference(pRefCell, pRefValue);

        pEqn.solve();

        if (simple.finalNonOrthogonalIter())
        {
            phi += pEqn.flux();
        }

additionally you are relaxing rho if transonic = false

Code:

if (!simple.transonic())
{
    rho.relax();
}

Tobi

yash.aesi August 28, 2013 07:47

regarding BC's of rhoSimplecFoam
 
1 Attachment(s)
helo ,
i am trying to simulate cold flow in my case using rhoSimplecFoam . my case is having 2 inlets , upper wall (fixed ), outlet and axis of symmetry . after running the case following error and as per my knowledge it is due to the BC's . So can anybody plz have a look on my BC's and tell me whr i am doin wrong .
thanks in advance :)

Code:

Time = 44

GAMG:  Solving for Ux, Initial residual = 0.72868, Final residual = 0.0331103, No Iterations 1
GAMG:  Solving for Uy, Initial residual = 0.964565, Final residual = 0.00777282, No Iterations 1
GAMG:  Solving for e, Initial residual = 0.827116, Final residual = 0.00785967, No Iterations 1
GAMG:  Solving for p, Initial residual = 0.242665, Final residual = 0.0241799, No Iterations 2
time step continuity errors : sum local = 0.308447, global = -0.151188, cumulative = -1.05624
rho max/min : 1 0.1
GAMG:  Solving for epsilon, Initial residual = 0.089338, Final residual = 1.19406e-05, No Iterations 1
GAMG:  Solving for k, Initial residual = 0.778841, Final residual = 0.00695333, No Iterations 1
bounding k, min: 6.9946e-16 max: 2794 average: 2.36892
ExecutionTime = 1150.91 s  ClockTime = 1151 s

Time = 45

GAMG:  Solving for Ux, Initial residual = 0.561691, Final residual = 0.0130153, No Iterations 1
GAMG:  Solving for Uy, Initial residual = 0.975585, Final residual = 0.0459448, No Iterations 1
GAMG:  Solving for e, Initial residual = 0.908425, Final residual = 0.00318615, No Iterations 2
#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::hePsiThermo<Foam::psiThermo, Foam::pureMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::calculate() at ??:?
#4  Foam::hePsiThermo<Foam::psiThermo, Foam::pureMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::correct() at ??:?
#5 
 at ??:?
#6  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7 
 at ??:?
Floating point exception (core dumped)



All times are GMT -4. The time now is 15:28.