CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

SRF compressible rhoSimpleFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 1, 2022, 06:17
Default SRF compressible rhoSimpleFoam
  #1
New Member
 
Zeinab Abosedaira
Join Date: Mar 2022
Posts: 24
Rep Power: 4
ZeinabM is on a distinguished road
Hello, I hope you're doing well. So, now there is a task required from me to edit rhoSimpleFoam solver to accommodate the SRF model. I copied the solver to my application file and performed some edits. Also, I have done some edits in the SRFModel.H and SRFModel.C. I compile the new solver and everything is good, when I get to use it with a problem, it gives me an error of inconsistent units. I've successfully known where the inconsistency happens but I don't why.

Code:
--> FOAM FATAL ERROR: (openfoam-2012)

    [Urel[1 -2 -2 0 0 0 0] ] + [(Fcoriolis+Fcentrifugal)[0 1 -2 0 0 0 0] ]

    From void Foam::checkMethod(const Foam::fvMatrix<Type>&, const Foam::DimensionedField<Type, Foam::volMesh>&, const char*) [with Type = Foam::Vector<double>]
    in file /opt/OpenFOAM/OpenFOAM-v2012/src/finiteVolume/lnInclude/fvMatrix.C at line 1351.

FOAM aborting
I put some flags to know where the error is, and it turned out that it happens when solving the Urel equation.
Code:
  tmp<fvVectorMatrix> tUrelEqn
   (
        fvm::div(phi, Urel)
        + SRF -> SuCompressible()
        + turbulence->divDevRhoReff(Urel)
     ==
        fvOptions(rho, Urel)
    );
Below I am sharing SRFModel.C, the lines in bold are the edited lines:
Code:
\*---------------------------------------------------------------------------*/

#include "SRFModel.H"
#include "SRFVelocityFvPatchVectorField.H"

// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

namespace Foam
{
    namespace SRF
    {
        defineTypeNameAndDebug(SRFModel, 0);
        defineRunTimeSelectionTable(SRFModel, dictionary);
    }
}


// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
Foam::SRF::SRFModel::SRFModel
(
    const word& type,
    const volVectorField& Urel,
    const volScalarField& rho 
)
:
    IOdictionary
    (
        IOobject
        (
            "SRFProperties",
            Urel.time().constant(),
            Urel.db(),
            IOobject::MUST_READ_IF_MODIFIED,
            IOobject::NO_WRITE
        )
    ),
    Urel_(Urel),
    rho_ (rho),
    mesh_(Urel_.mesh()),
    origin_("origin", dimLength, get<vector>("origin")),
    axis_(normalised(get<vector>("axis"))),
    SRFModelCoeffs_(optionalSubDict(type + "Coeffs")),
    omega_(dimensionedVector("omega", dimless/dimTime, Zero))
{}


// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //

Foam::SRF::SRFModel::~SRFModel()
{}


// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //

bool Foam::SRF::SRFModel::read()
{
    if (regIOobject::read())
    {
        // Re-read origin
        readEntry("origin", origin_);

        // Re-read axis
        readEntry("axis", axis_);
        axis_.normalise();

        // Re-read sub-model coeffs
        SRFModelCoeffs_ = optionalSubDict(type() + "Coeffs");

        return true;
    }

    return false;
}


const Foam::dimensionedVector& Foam::SRF::SRFModel::origin() const
{
    return origin_;
}


const Foam::vector& Foam::SRF::SRFModel::axis() const
{
    return axis_;
}


const Foam::dimensionedVector& Foam::SRF::SRFModel::omega() const
{
    return omega_;
}


Foam::tmp<Foam::DimensionedField<Foam::vector, Foam::volMesh>>
Foam::SRF::SRFModel::FcoriolisCompressible() const
{
    return tmp<volVectorField::Internal>
    (
        new volVectorField::Internal
        (
            IOobject
            (
                "FcoriolisComp",
                mesh_.time().timeName(),
                mesh_,
                IOobject::NO_READ,
                IOobject::NO_WRITE
            ),
            rho_* 2.0*omega_ ^ Urel_
        )
    );
}

Foam::tmp<Foam::DimensionedField<Foam::vector, Foam::volMesh>>
Foam::SRF::SRFModel::FcentrifugalCompressible() const
{
    return tmp<volVectorField::Internal>
    (
        new volVectorField::Internal
        (
            IOobject
            (
                "FcentrifugalComp",
                mesh_.time().timeName(),
                mesh_,
                IOobject::NO_READ,
                IOobject::NO_WRITE
            ),
            rho_ *omega_ ^ (omega_ ^ (mesh_.C() - origin_))
        )
    );
}

Foam::tmp<Foam::DimensionedField<Foam::vector, Foam::volMesh>>
Foam::SRF::SRFModel::SuCompressible() const
{
    return FcoriolisCompressible() + FcentrifugalCompressible();
}
The problem might be in the process of incorporating the rho in the SRFModel files, but I don't know exactly where it is.
ZeinabM is offline   Reply With Quote

Old   August 3, 2022, 07:54
Default
  #2
New Member
 
Kuba
Join Date: Sep 2020
Posts: 2
Rep Power: 0
Ununul is on a distinguished road
The problem is coming from dimensions inconsistency. Are you sure that your Urel variable should have dimension kg m^-2 s^-2?

Greetings
Ununul is offline   Reply With Quote

Reply

Tags
compressible, rhosimplefoam, srf


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
rhoSimpleFoam: Does it work with SRF problems? ZeinabM OpenFOAM Running, Solving & CFD 2 July 28, 2022 05:55
rhoSimpleFoam for sub-sonic compressible aerodynamics. bentkj OpenFOAM Running, Solving & CFD 6 October 1, 2018 03:18
rhoSimpleFoam with SpalartAllmaras model for compressible flow usc2018 OpenFOAM Running, Solving & CFD 0 May 7, 2018 19:01
Compressible 2D airfoil rhoSimpleFoam fatal error volScalarField none jfournier OpenFOAM Running, Solving & CFD 4 September 28, 2017 06:28
how is rhoSimpleFoam a compressible steady statefor compressible flow cleoo OpenFOAM Pre-Processing 2 September 22, 2016 03:23


All times are GMT -4. The time now is 22:13.