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

setReference pressure problem when having source term in pdEqn

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By t.teschner
  • 1 Post By t.teschner
  • 1 Post By t.teschner
  • 1 Post By t.teschner

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   May 7, 2019, 20:25
Default setReference pressure problem when having source term in pdEqn
  #1
Senior Member
 
Daniel
Join Date: Mar 2013
Location: Noshahr, Iran
Posts: 348
Rep Power: 21
Daniel_Khazaei will become famous soon enough
Dear foamers,

I'm working on a problem dealing with evaporation and condensation of water inside a closed domain. The fixedFluxPressure boundary condition is applied on all the boundaries which necessitate the need for setting a reference pressure before solving the pdEqn.

The evaporation-condensation model adds a mass transfer source in pdEqn as follow:

Code:
        fvScalarMatrix pdEqn
        (
            fvc::div(phiHbyA)
          - fvm::laplacian(rAUf, pd_)
          - (vDotc - vDotv)
        );
The problem is the reference pressure location has an unexpected effect on the simulation which seems totally unrealistic. If I remove the source term from the equation, then everything becomes completely normal. This finally cause the temperature field to become unbounded and drops way below physical temperature range allowed inside the domain. The contours of velocity and temperature shows the problem:





If it helps further investigating the issue, here is the full pEqn function:

Code:
void interPhaseChangeFluid::pEqn
(
    const fvMesh& mesh, const fvVectorMatrix& UEqn
)
{
    rAU_ = 1.0/UEqn.A();
    surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU_));

    volVectorField HbyA("HbyA", U_);
    HbyA = rAU_*UEqn.H();

    surfaceScalarField phiHbyA
    (
        "phiHbyA",
        (fvc::interpolate(HbyA) & mesh.Sf())
      + fvc::ddtPhiCorr(rAU_, rho_, U_, phi_)
    );

    #include "updateRobinFsiInterface.H"

    adjustPhi(phiHbyA, U_, pd_);

    //- calculating surface tension flux
    //- + gravitational flux
    surfaceScalarField phig
    (
        interface_.capillaryFlux(rAUf)
      - ghf_*fvc::snGrad(rho_)*rAUf*mesh.magSf()
    );

    //- adding the resulting flux to the main flux
    phiHbyA += phig;

    Pair<tmp<volScalarField> > vDot = phaseChangeModel_->vDot();
    const volScalarField& vDotc = vDot[0]();
    const volScalarField& vDotv = vDot[1]();

    while (pimple_.correctNonOrthogonal())
    {
        fvScalarMatrix pdEqn
        (
            fvc::div(phiHbyA)
          - fvm::laplacian(rAUf, pd_)
          - (vDotc - vDotv)
        );

        pdEqn.setReference(pRefCell_, getRefCellValue(pd_, pRefCell_));

        pdEqn.solve
        (
            mesh.solutionDict().solver(pd_.select(pimple_.finalInnerIter()))
        );

        if (pimple_.finalNonOrthogonalIter())
        {
            phi_ = phiHbyA + pdEqn.flux();

            U_ = HbyA + rAU_*fvc::reconstruct((phig + pdEqn.flux())/rAUf);
            U_.correctBoundaryConditions();
            gradU_ = fvc::grad(U_);
        }
    }

    //- re-evaluate pressure using additional terms
    p_ = pd_ + rho_*gh_;
    p_.correctBoundaryConditions();
    gradp_ = fvc::grad(p_);

    if (pd_.needReference())
    {
        p_ += dimensionedScalar
        (
           "p",
            p_.dimensions(),
            pRefValue_ - getRefCellValue(p_, pRefCell_)
        );
        pd_ = p_ - rho_*gh_;
    }

    //- Make the fluxes relative to the mesh motion
    fvc::makeRelative(phi_, U_);
}
Regards,
D.Khazaei
Daniel_Khazaei is offline   Reply With Quote

 


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
[Other] Tabulated thermophysicalProperties library chriss85 OpenFOAM Community Contributions 62 October 2, 2022 03:50
[swak4Foam] Installation Problem with OF 6 version Aurel OpenFOAM Community Contributions 14 November 18, 2020 16:18
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 ordinary OpenFOAM Installation 19 September 3, 2019 18:13
pisoFOAM (LES) - internal pipe flow - convergence gu1 OpenFOAM Running, Solving & CFD 0 January 11, 2018 16:39
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 11:44


All times are GMT -4. The time now is 18:46.