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

Transport of solutes

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By Jose Manuel Olmos
  • 2 Post By Jose Manuel Olmos

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   October 5, 2021, 06:23
Default Transport of solutes
  #1
New Member
 
José Manuel Olmos Martínez
Join Date: Mar 2021
Posts: 8
Rep Power: 5
Jose Manuel Olmos is on a distinguished road
Hello everyone,

I'm trying to simulate the flow of a solution (containing a solute) inside a pipe. I'm using the icoFoam solver with some modifications on the code for including the transport of the solute (just after calculating the distribution of velocities):

[I]fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
- fvm::laplacian(nu, U)
);

if (piso.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));
}

// --- PISO loop
while (piso.correct())
{
volScalarField rAU(1.0/UEqn.A());
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
surfaceScalarField phiHbyA
(
"phiHbyA",
fvc::flux(HbyA)
+ fvc::interpolate(rAU)*fvc::ddtCorr(U, phi)
);
adjustPhi(phiHbyA, U, p);
// Update the pressure BCs to ensure flux consistency
constrainPressure(p, U, phiHbyA, rAU);

// Non-orthogonal pressure corrector loop
while (piso.correctNonOrthogonal())
{
// Pressure corrector
fvScalarMatrix pEqn
(
fvm::laplacian(rAU, p) == fvc::div(phiHbyA)
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();

if (piso.finalNonOrthogonalIter())
{
phi = phiHbyA - pEqn.flux();
}
}
#include "continuityErrs.H"
U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
}
// --- Mass transport

dictionary soluteSolveDict = mesh.solutionDict().subDict("solvers").subDict("C_ solutes");
forAll(soluteNameList, i)
{
fvScalarMatrix MassTransport
(
fvm::ddt(soluteList[i]) + fvm::div(phi, soluteList[i], "div(phi,C_solutes)")
- fvm::laplacian(soluteList[i].D(), soluteList, "laplacian(D,C_solutes)")
);
MassTransport.solve(soluteSolveDict);
}


// --- Write run time


The solver is running and the distribution of concentrations is calculated. However, it only takes part from the inlet of the pipe.. I mean, the transport of the momentum and the concentration of the solute is not "synchronized. You can see this problem in the following images, that show the distribution of velocities and concentrations at the same time:

https://ibb.co/bQLCf2v
https://ibb.co/7XSj25K

Before running the simulation, I created a new field ("concentration") with the following boundary conditions:

dimensions [0 -3 0 0 1 0 0];

internalField uniform 0;

boundaryField
{
CAD_inlet
{
type fixedValue;
value uniform 0.01; //this is the concentration of the solute at
//the inlet
}

CAD_outlet
{
type zeroGradient;
}

CAD_wall
{
type zeroGradient;
}
}


I don't understand why the solution reach the outlet of the pipe (the velocity is non-null at this zone) but the solute is only at the first of the pipe. I would be very grateful if anyone could tell me if I'm taking any mistake on the modification of the solver or in the establishment of the boundary conditions.

Thanks in advance,
Jose Manuel
GregNordin likes this.
Jose Manuel Olmos 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
Transport of solutes Jose Manuel Olmos Main CFD Forum 5 October 18, 2021 11:26
How can temperature e treated as a passive scalar be used in transport equation? granzer OpenFOAM Running, Solving & CFD 3 June 6, 2021 16:35
[swak4Foam] swakExpression not writing to log alexfells OpenFOAM Community Contributions 3 March 16, 2020 18:19
Solving User-defined Scalar Transport Equation properly meepokman Fluent UDF and Scheme Programming 0 July 10, 2018 07:57
Tcp transport error Adriana FLUENT 1 December 21, 2012 05:31


All times are GMT -4. The time now is 16:05.