CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Propellerfanrotating machinery (http://www.cfd-online.com/Forums/openfoam-solving/59846-propellerfanrotating-machinery.html)

clo January 26, 2007 12:08

hello everybody, I'm beginning
 
hello everybody, I'm beginning to work with OF to simulate a propeller. For the moment I'm trying to modify the 3Dmixer case and make it work with icoDynFoam. I added inlet and outlet patches and now the case run even if results aren't too much realistic (I'm at the beginning, after all!). I saw in the forum that a few guys are discussing about it...what if we share ideas all together? Basically the idea is to add to mixer3D step by step inlet&outlet,turbulence,and two-phase (and then adding complexity in geometry). Is there someone interested about the subject?

ciao
clo

clo January 30, 2007 05:30

Hi, I'm trying to add turbulen
 
Hi, I'm trying to add turbulence in icoDynFoam generating a new solver called TurboFoam.


here is my TurboFoam.c

#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
#include "incompressible/turbulenceModel/turbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

# include "setRootCase.H"

# include "createTime.H"
# include "createDynamicFvMesh.H"
# include "readPISOControls.H"
# include "initContinuityErrs.H"
# include "createFields.H"
# include "readTimeControls.H"

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

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

while (runTime.run())
{
# include "readPISOControls.H"
# include "readTimeControls.H"
# include "CourantNo.H"

if (mesh.moving())
{
// Make the fluxes absolute
phi += fvc::meshPhi(U);
}

# include "setDeltaT.H"

runTime++;

Info<< "Time = " << runTime.timeName() << nl << endl;

bool meshChanged = mesh.update();

if (mesh.moving() || meshChanged)
{
# include "correctPhi.H"
}

if (mesh.moving())
{
// Make the fluxes relative
phi -= fvc::meshPhi(U);
}

# include "UEqn.H"

// --- PISO loop

for (int corr=0; corr<nCorr; corr++)
{
rUA = 1.0/UEqn.A();

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"

if (mesh.moving())
{
// Make the fluxes relative
phi -= fvc::meshPhi(U);
}

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

turbulence->correct();

runTime.write();

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

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

return(0);
}



and my UEqn.H


fvVectorMatrix UEqn
(
fvm::div(phi, U)
+ turbulence->divR(U)
);

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


when I run wmake this is the output


UEqn.H:4: error: 'turbulence' was not declared in this scope

I can't understand what's wrong and what this error is about...
any ideas?
thanx
ciao

rafal January 30, 2007 06:55

for me it sounds like lack of
 
for me it sounds like lack of (in file Make/option)
-I$(LIB_SRC)/turbulenceModels in EXE_INC
and/or
-lincompressibleTurbulenceModels in EXE_LIBS

but it is a wild guess http://www.cfd-online.com/OpenFOAM_D...part/happy.gif
good luck
rafal
compare it with :
~/OpenFOAM/OpenFOAM-1.3/applications/solvers/
incompressible/turbFoam/Make/option

philippose January 30, 2007 07:07

Hi, A Good day to you!
 
Hi,
A Good day to you!

For the solver you are trying to put together, the "options" file in the "Make" folder should be as follows:

EXE_INC = \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/transportModels

EXE_LIBS = \
-ldynamicFvMesh \
-ldynamicMesh \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels \
-lfiniteVolume \
-lmeshTools

This will bring in the turbulence models which you need to incorporate turbulence into the solver.

Have a nice day!

Philippose

clo January 30, 2007 09:03

thank you for the hints, but I
 
thank you for the hints, but I already modified my option file this way....the error is still there!

rafal January 30, 2007 09:20

another guess in createFields.
 
another guess in createFields.H include this bit:

autoPtr<turbulencemodel> turbulence
(
turbulenceModel::New(U, phi, laminarTransport)
);

hope this help
rafal

clo January 30, 2007 09:37

thanx rafal but also this isn'
 
thanx rafal but also this isn't the problem...I think I really have to control one more time the code..

philippose January 30, 2007 13:48

Hi again, I am sorry... I did
 
Hi again,
I am sorry... I didnt look at the error message you were getting.

Try this....

Just before the line

#include "UEqn.H"

put in a "{", and put in a closing "}" just before the line

turbulence->correct();

If that doest work, pull the code in the "UEqn.H" include file directly into the main code of the solver, and again put in the "{" and the "}" in the same locations as above.

Let me know if it works :-)!

By the way... if I am not mistaken, shouldnt the "UEqn" be:

fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
+ turbulence->divR(U)
);

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

I just happened to notice it... you need the time differential of "U" in the equation too.

Philippose


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