CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Error while solving channel flow using RAS (http://www.cfd-online.com/Forums/openfoam-programming-development/113800-error-while-solving-channel-flow-using-ras.html)

inpepwetrust February 26, 2013 20:31

Error while solving channel flow using RAS
 
Hey there,

I have a task of solving a basic channel flow problem using RAS Model (kEpsilon model).
First I started with channelFoam which is an LES solver, I edited the solver code file channelFoam.C, createFields.H, Make/files and Make/options.

In channelFoam.C,

I did the following changes,
1. I commented out #Include "LESModel.H" and added #Include "RASModel.H"
2. I added #Include "turbulenceModel.H"
3. Changed the parameter inside the while loop from runtime.loop() to runtime.run().
4. Added #Include "setDeltaT.H" and runtime++ inside the loop.
5. After that in line 79, I changed divDevBeff(U) to divDevReff()

In createFields.H,
I replaced LESModel with RASModel in lines 42 and 40.

Similarly I did all the changes required to be done in Make/files and Make/options. I compiled the solver and it worked.

Now, in my case file, I edited the input values in 0 folder accordingly. That is, I edited epsilon k nut nuTilda p R U accordingly.

blockMesh didn't give me any problem.

Then, when I used my solver, I got the following errors,

#0 Foam::error:: printStack(Foam::Ostream&) at /usr/apps1/openfoam-2.1.1/OpenFOAM-2.1.1/src/OSspecific/POSIX/printStack.C:201

#1 Foam::sigFpe::sigHandler(int) at /usr/apps1/openfoam-2.1.1/OpenFOAM-2.1.1/src/OSspecific/POSIX/signals/sigFpe.C:117

#2 __restore_rt at sigaction.c:0

#3 Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) at /usr/apps1/openfoam-2.1.1/OpenFOAM-2.1.1/src/OpenFOAM/fields/Fields/scalarField/scalarField.C:95

#4 void Foam::divide<Foam::fvPatchField>(Foam::FieldField< Foam::fvPatchField, double>&, Foam::FieldField<Foam::fvPatchField, double> const&, Foam::FieldField<Foam::fvPatchField, double> const&) at /usr/apps1/openfoam-2.1.1/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/scalarFieldField.C:89

#5 void Foam::divide<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at /usr/apps1/openfoam-2.1.1/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/GeometricScalarField.C:114

#6 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam:: operator/<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<doub le, Foam::fvPatchField, Foam::volMesh> > const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at /usr/apps1/openfoam-2.1.1/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/GeometricScalarField.C:114

#7 Foam::incompressible::RASModels::kEpsilon::correct () at /usr/apps1/openfoam-2.1.1/OpenFOAM-2.1.1/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C:237

#8 main at ~/OpenFOAM/kmani-2.1.1/applications/solvers/incompressible/channelRASFoam/channelFoam.C:83

#9 __libc_start_main in "/lib64/libc.so.6"

#10 Foam::regIOobject::writeObject(Foam::IOstream::str eamFormat, Foam::IOstream::versionNumber, Foam::IOstream::compressionType) const in "/usr/erc/people/kmani/OpenFOAM/kmani-2.1.1/platforms/linux64Gcc44DPDebug/bin/channelRASFoam"


Could anyone suggest me what to do?

fredo490 March 4, 2013 07:33

Why not using another solver ?

chegdan March 4, 2013 11:10

Quote:

Originally Posted by fredo490 (Post 411334)
Why not using another solver ?

I think this is a good suggestion. if you are using 2.1.x, why not try to use simpleFoam with the appropriate source addition? Take a look at the case

Code:

$FOAM_TUTORIALS/incompressible/simpleFoam/turbineSiting
and look at the constant/sourcesProperties file. Copy the sourcesProperties to your case and replace the contents with something like:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.x                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "constant";
    object      sourcesProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

pressureGradientDriven
{
    type pressureGradientExplicitSource;
    active on; //on/off switch
    timeStart 0.0; //start time
    duration 1e10; //duration
    selectionMode all; //cellSet // points //cellZone

    pressureGradientExplicitSourceCoeffs
    {
            UName      U;          // name of velocity field
            Ubar        (10.0 0 0); // desired average velocity related to Re
            gradPini    gradPini [0 2 -2 0 0] 0; // initial pressure gradient
            flowDir    (1 0 0);    // flow direction
      }
}

// ************************************************************************* //

Note: Currently only handles kinematic pressure

This was found on this page and this page. I have not tested this particular bit of code i have pasted here so you may have to debug it. Good luck.


All times are GMT -4. The time now is 02:04.