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

Cyclic Boundary conditions

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 4, 2008, 10:41
Default Hi, I am a beginner in Open
  #1
Senior Member
 
John Deas
Join Date: Mar 2009
Posts: 160
Rep Power: 17
johndeas is on a distinguished road
Hi,

I am a beginner in OpenFOAM, and I would like to use it to perform DNS calculation of turbulent channel flow. I need a periodic condition on inlet/outlet and sides, and a wall condition on lower/upper wall. Since I need a driving force for the flow, I tried to include the gradp from channeloodles into icoFoam. My calculation runs, but it seems that my wall condition is not taken into account, as the flow is constant in the channel and correspond to the value I wrote as "ubar" in the transportProperties dictionnary.

My modified code is

#include "fvCFD.H"
#include "IFstream.H"
#include "OFstream.H"
#include "Random.H" // peut-être inutile

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

int main(int argc, char *argv[])
{

# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
# include "createFields.H"
# include "initContinuityErrs.H"
# include "createGradP.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Info<< "\nStarting time loop\n" << endl;

for (runTime++; !runTime.end(); runTime++)
{
Info<< "Time = " << runTime.timeName() << nl << endl;

# include "readPISOControls.H"
# include "CourantNo.H"

fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
- fvm::laplacian(nu, U)
==
flowDirection*gradP
);

solve(UEqn == -fvc::grad(p));

// --- PISO loop

volScalarField rUA = 1.0/UEqn.A();

for (int corr=0; corr<nCorr; corr++)
{


U = rUA*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, U, phi);

adjustPhi(phi, U, p);

for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::laplacian(rUA, p) == fvc::div(phi)
);

pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();

if (nonOrth == nNonOrthCorr)
{
phi -= pEqn.flux();
}
}

# include "continuityErrs.H"

U -= rUA*fvc::grad(p);
U.correctBoundaryConditions();
}

// Correct driving force for a constant mass flow rate

// Extract the velocity in the flow direction
dimensionedScalar magUbarStar =
(flowDirection & U)().weightedAverage(mesh.V());

// Calculate the pressure gradient increment needed to
// adjust the average flow-rate to the correct value
dimensionedScalar gragPplus =
(magUbar - magUbarStar)/rUA.weightedAverage(mesh.V());

U += flowDirection*rUA*gragPplus;

gradP += gragPplus;

Info<< "Uncorrected Ubar = " << magUbarStar.value() << tab
<< "pressure gradient = " << gradP.value() << endl;

runTime.write();

Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}

Info<< "End\n" << endl;

return(0);
}


// ************************************************** *********************** //

Can you help me or give some direction to debug ?

Thanks

JD
johndeas is offline   Reply With Quote

Old   January 4, 2008, 21:34
Default Hello I think you can just
  #2
Senior Member
 
santos's Avatar
 
Jose Luis Santos
Join Date: Mar 2009
Location: Portugal
Posts: 215
Rep Power: 18
santos is on a distinguished road
Send a message via Skype™ to santos
Hello

I think you can just use channelOodles for your situation. Why do you need to write another solver?

Regards
José Santos
santos 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cyclic boundary conditions axisymmetric gabriel OpenFOAM Running, Solving & CFD 0 July 27, 2007 12:24
Cyclic boundary conditions hadi OpenFOAM Running, Solving & CFD 0 June 29, 2007 11:46
periodic and cyclic boundary conditions Hadi Main CFD Forum 2 June 29, 2007 08:19
Channel flow with cyclic boundary conditions nzy102 OpenFOAM Running, Solving & CFD 0 April 19, 2007 17:13
cyclic boundary conditions.. Zerrin Siemens 0 June 11, 2005 14:49


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