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

Comparison between fvc::ddtPhiCorr and fvc::ddtCorr (old solver recreation)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 5, 2020, 11:44
Default Comparison between fvc::ddtPhiCorr and fvc::ddtCorr (old solver recreation)
  #1
New Member
 
ScalarVectorTensor
Join Date: Mar 2020
Posts: 4
Rep Power: 6
ScalarVectorTensor is on a distinguished road
Hello Foamers

Just a quick one today hopefully, I am working on “resurrecting” some old solvers written by a colleague which were made on openFoam 2.1 to openFoam 6 so they can be later modified. The solvers seem to be based on the openFoam 2.1 version of buoyantBoussinesqPimpleFoam. Everything is going ok apart from one function. The equation in the old solver is as follows.

phi = (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rAU, U, phi);

Attempting to run on openFoam 6 generates an error message stating that ddtPhiCorr is not a recognised part of fvc and did I intend to use fvc::ddtCorr. However using the equation

phi = (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtCorr(rAU, U, phi);

results in an error stating that the units of phi are incorrect when the solver is ran. I decided to consult the openFoam 2.3 version of buoyantBoussinesqPimpleFoam as this is where I believe the function fvc::ddtPhiCorr was removed from openFoam. I found that the equation is

surfaceScalarField phiHbyA
(
"phiHbyA",
(fvc::interpolate(HbyA) & mesh.Sf())
+ rAUf*fvc::ddtCorr(U, phi)
+ phig
);

As can be seen the first term is exactly the same in both versions, but the second term is rAUf*fvc::ddtCorr(U, phi) using the equation

phi = (fvc::interpolate(U) & mesh.Sf()) + rAUf*fvc::ddtCorr(U, phi);

enables the solver to compile and run successfully. One important thing to note is that rAUf has the same definition in both versions of surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
Also the appearace of phig in the second equation but not in the first equation should not be a concern as the same term phig= rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf() is added at a later point in the older version.

In short I just need to know if (fvc::interpolate(HbyA) & mesh.Sf()) + rAUf*fvc::ddtCorr(U, phi) == (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rAU, U, phi) hence does rAUf*fvc::ddtCorr(U, phi) == fvc::ddtPhiCorr(rAU, U, phi).

Thanks,

ScalarVectorTensor
ScalarVectorTensor is offline   Reply With Quote

Reply


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



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