Hallo, ich versuche seit zwei Tagen, en Zeitschritt im icoFoam anzupsasen, damit die Courantzahl nicht in unendliche Höhen geht, und die Berechnung sinnfrei wird. Ich habe bereits folgenden Code mit Hilfe des Internets zusammengebastelt:
#include "fvCFD.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "CourantNo.H"
# include "setInitialDeltaT.H"
// included
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime++; runTime.end(); runTime++)
{
# include "readTimeControls.H"
# include "CourantNo.H"
# include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readPISOControls.H"
fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
- fvm::laplacian(nu, U)
);
solve(UEqn == -fvc::grad(p));
// --- PISO loop
while (int corr=0; corr<nCorr; corr++)
{
volScalarField rAU(1.0/UEqn.A());
U = rAU*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, U, phi);
adjustPhi(phi, U, p);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::laplacian(rAU, p) == fvc::div(phi)
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
{
phi -= pEqn.flux();
}
}
#include "continuityErrs.H"
U -= rAU*fvc::grad(p);
U.correctBoundaryConditions();
}
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return 0;
}
Nach wclean, und wmake im entsprechenden Ordner spuckt mir mein LieblingsEndgerät folgendes aus:
Making dependency list for source file myIcoFoam.C
SOURCE=myIcoFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam211/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam211/src/OpenFOAM/lnInclude -I/opt/openfoam211/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/myIcoFoam.o
myIcoFoam.C: In Funktion »int main(int, char**)«:
myIcoFoam.C:63:19: Fehler: »runTime.Foam::Time: perator++(0)« konnte nicht von »Foam::Time« nach »bool« umgewandelt werden
myIcoFoam.C:63:21: Fehler: expected »)« before »;« token
myIcoFoam.C:63:47: Fehler: expected »;« before »)« token
In file included from myIcoFoam.C:45:0:
/opt/openfoam211/src/finiteVolume/lnInclude/initContinuityErrs.H:37:8: Warnung: Variable »cumulativeContErr« wird nicht verwendet [-Wunused-variable]
In file included from myIcoFoam.C:47:0:
/opt/openfoam211/src/finiteVolume/lnInclude/readTimeControls.H:38:8: Warnung: Variable »maxDeltaT« wird nicht verwendet [-Wunused-variable]
myIcoFoam.C:130:1: Fehler: expected »}« at end of input
make: *** [Make/linux64GccDPOpt/myIcoFoam.o] Fehler 1
womit ich wenig anfangen kann.
Kann mir vielleicht jemand helfen??
Ein bissschen verzweifelte Grüße aus Freising