|
[Sponsors] |
setReference pressure problem when having source term in pdEqn |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 7, 2019, 20:25 |
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 |
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) ); 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_); } D.Khazaei |
|
|
|
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 |