|
[Sponsors] |
March 19, 2019, 09:13 |
projectionFoam - ERROR.
|
#1 |
Senior Member
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10 |
Hi,
I'm doing some tests on the algorithm created by Asim Onder and Johan Meyers (HPC realization of a controlled turbulent jet using OpenFOAM) and I'm finding some limitations and wanted help. The impression I had is that the flow 'froze', is not advancing the timeStep. The image I attached below led me to believe this, as the average flow did not change. Below is the code so you can comment. The reference article is easily accessible. My intention was to use a method similar to that used in ANSYS (Fractional Step Method), but ''it does not exist in OpenFOAM'' (I did not find it yet), so I decided to test this method of projection. OF5.0: LINK or, Code:
\*---------------------------------------------------------------------------*/ #include "fvCFD.H" #include "singlePhaseTransportModel.H" #include "turbulentTransportModel.H" #include "pisoControl.H" #include "fvOptions.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { #include "postProcess.H" #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" #include "createControl.H" #include "createFields.H" #include "createFvOptions.H" #include "initContinuityErrs.H" turbulence->validate(); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; while (runTime.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; #include "CourantNo.H" // Non-iterative projection scheme { //linearization of convective flux using second order extrapolation surfaceScalarField phi_o(0.5*(3.0*phi.oldTime()-phi.oldTime().oldTime())); // Solve the Momentum equation //MRF.correctBoundaryVelocity(U); fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi_o, U) //+ MRF.DDt(U) + turbulence->divDevReff(U) == fvOptions(U) ); UEqn.relax(); fvOptions.constrain(UEqn); if (piso.momentumPredictor()) { solve(UEqn == -fvc::grad(p)); fvOptions.correct(U); } // --- Projection step dimensionedScalar dt=runTime.deltaT(); //scalar rDeltaT=1.0/dt.value(); //WARNING: Variable is not being used. U += dt*fvc::grad(p); U.correctBoundaryConditions(); surfaceScalarField phi("phi", fvc::interpolate(U) & mesh.Sf()); //MRF.makeRelative(phi); adjustPhi(phi, U, p); // Update the pressure BCs to ensure flux consistency //constrainPressure(p, U, phi, MRF); //ERROR. // Non-orthogonal pressure corrector loop while (piso.correctNonOrthogonal()) { // Pressure corrector fvScalarMatrix pEqn ( fvm::laplacian(dt, p) == fvc::div(phi) ); pEqn.setReference(pRefCell, pRefValue); pEqn.solve(mesh.solver(p.select(piso.finalInnerIter()))); if (piso.finalNonOrthogonalIter()) { phi -= pEqn.flux(); } } #include "continuityErrs.H" U -= dt*fvc::grad(p); U.correctBoundaryConditions(); fvOptions.correct(U); } laminarTransport.correct(); turbulence->correct(); runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; } Info<< "End\n" << endl; return 0; } // ************************************************************************* // *About MRF: I commented in the code for not knowing if there would be need to use. I do not know what its function. |
|
Tags |
openfoam 5.0, projection method |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM.org] compile error in dynamicMesh and thermophysicalModels libraries | NickG | OpenFOAM Installation | 3 | December 30, 2019 01:21 |
[blockMesh] blockMesh with double grading. | spwater | OpenFOAM Meshing & Mesh Conversion | 92 | January 12, 2019 10:00 |
[swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh | gschaider | OpenFOAM Community Contributions | 300 | October 29, 2014 19:00 |
OpenFOAM without MPI | kokizzu | OpenFOAM Installation | 4 | May 26, 2014 10:17 |
DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 18:51 |