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

Error updating phi in scalarTransportFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 12, 2017, 12:27
Default Error updating phi in scalarTransportFoam
  #1
Senior Member
 
Join Date: Jul 2013
Posts: 124
Rep Power: 12
wildfire230 is on a distinguished road
Hi all,

I am basically working with a modified scalarTransportFoam that considers the motion of two different scalar fields, one is some dissolved solute, and the other represents the concentration of a particle suspension. There is a phenomenon known as diffusiophoresis in which particles spontaneously move in the presence of a solute gradient.

Long story short, I need to modify the advection-diffusion equation with an additional term: gammap * grad(Cions) / Cions, where gammap is a constant and Cions is my solute ion concentration, which is updated every time step. That update just uses basically exactly the same equation as scalarTransportFoam, and that is working correctly.

Now, in my equation to update the particle concentration, I define a new updated velocity and phi:

volVectorField U_New = U + gammap / Cions * fvc::grad(Cions);
surfaceScalarField phiNew = linearInterpolate(U_New) & mesh.Sf();

and then my CpartEqn (particle concentration update equation) looks like this:

while (simple.correctNonOrthogonal())
{
volVectorField U_New = U + gammap/Cions*fvc::grad(Cions);
surfaceScalarField phiNew = linearInterpolate(U_New) & mesh.Sf();

fvScalarMatrix CpartEqn
(
fvm::ddt(Cpart)
+fvm::div(phiNew,Cpart)
-fvm::laplacian(Dpart,Cpart)
);

CpartEqn.relax();
fvOptions.constrain(CpartEqn);
CpartEqn.solve();
fvOptions.correct(Cpart);
}

However, I am getting some strange results, and it looks like something funny is happening in the phiNew step of the calculation. For example, if I just forget about updating U and use

volVectorField U_New = U;
surfaceScalarField phiNew = linearInterpolate(U_New) & mesh.Sf();

Then my updated Cpart actually gives different results than if I just use phiNew = phi;

Does that make sense??? Why would phiNew = linearInterpolate(U_New) & mesh.Sf(); give different results than phiNew = phi???

I can't understand.

Please help!

Thanks
wildfire230 is offline   Reply With Quote

Reply

Tags
phi scalartransportfoam


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
Question about phi jeanpinto24| OpenFOAM Pre-Processing 0 April 15, 2017 04:13
Correction procedure on a non-orthogonal skewed Mesh me.ouda OpenFOAM Programming & Development 0 January 18, 2017 09:05
phi in scalarTransportFoam, why not U pnovo OpenFOAM Programming & Development 1 December 18, 2015 17:14
mixerVesselAMI2D's mass is not balancing sharonyue OpenFOAM Running, Solving & CFD 6 June 10, 2013 09:34
Turbulence Model phi vs phi_ doug OpenFOAM Running, Solving & CFD 4 November 10, 2009 04:33


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