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

update nPhi in DPMFoam solver

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 8, 2025, 23:44
Default update nPhi in DPMFoam solver
  #1
New Member
 
yueshen
Join Date: Apr 2025
Posts: 2
Rep Power: 0
yueshen is on a distinguished road
Hi everyone,

I am modifying the DPMFoam solver, and coupling it with a DEM software. The UEqn is compiled as shown below. The porosity n is obtained from the DEM software.

fvVectorMatrix UEqn
(
fvm::ddt(n, U) + fvm::div(nPhi, U)
- fvm::Sp(fvc::ddt(n) + fvc::div(nPhi), U)
- n * fvm::laplacian(nu, U)
);


I create the surfaceScalarField nPhi by equation “fvc::interpolate(*n_)* (*phi_)” and write it in each writing inverval. However, the output value of nPhi is zero for every timestep.

nPhi_ = new surfaceScalarField (IOobject ("nPhi", runTime_->timeName(), *mesh_,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE),
fvc::interpolate(*n_)* (*phi_));


Questions:
1. Do I need to update nPhi in the nNonOrthogonalCorrectors, as shown below? Because the output update of nPhi is zero so I have tried to add it in this way, but the solver becomes unable to converge, i.e., the pressure blows up.

if (piso_->finalNonOrthogonalIter())
{

nf = fvc::interpolate(n);
phi = phiHbyA - pEqn.flux()/nf;
nPhi = phi*nf;

U = HbyA
+ rAUc*fvc::reconstruct
(
(phicSUSu - pEqn.flux()/nf)/rAUcf
);
U.correctBoundaryConditions();

}

2. From the DPMFoam in OpenFoam, why DPMFoam does not update nf and nPhi?

if (pimple.finalNonOrthogonalIter())
{
phic = phiHbyA - pEqn.flux()/alphacf;

p.relax();

Uc = HbyA
+ rAUc*fvc::reconstruct((phicForces - pEqn.flux()/alphacf)/rAUcf);
Uc.correctBoundaryConditions();
}

3. Does the selections of solver in fvSvheme plays a significant role in convergence?
Thanks!
yueshen is offline   Reply With Quote

Old   October 11, 2025, 03:14
Default
  #2
New Member
 
yueshen
Join Date: Apr 2025
Posts: 2
Rep Power: 0
yueshen is on a distinguished road
I think I found the bug. nPhi is updated at the beginning of the DPMFoam.C.
yueshen is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
The Solver Failed with a non zero exit code of 2 helpagurlout Main CFD Forum 0 April 6, 2024 17:36
Update failed for the Solution component in Fluid Flow (CFX). The solver failed with ihsanmm CFX 4 January 4, 2024 14:23
Fail to converge when solving with a fabricated solution zizhou FLUENT 0 March 22, 2021 07:33
Star cd es-ice solver error ernarasimman STAR-CD 2 September 12, 2014 01:01
thobois class engineTopoChangerMesh error Peter_600 OpenFOAM 4 August 2, 2014 10:52


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