|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
|
Hello Foamers
I am on my quest of learning openfoam trying to solve laplace equation on my own without using laplacian function. I am trying the following #include "fvCFD.H" #include "simpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // scalar calculateTemperature(scalar x,int id); int main(int argc, char *argv[]) { #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" simpleControl simple(mesh); #include "createFields.H" //#include "initContinuityErrs.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; scalar x[1]={0}; scalar y[1]={0}; scalar z[1]={0}; while (simple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; while (simple.correctNonOrthogonal()) { gradT=fvc::grad(T); for (label cellid= 0; cellid <mesh.C().size(); cellid++) { for (label faceid= 0; faceid <mesh.owner().size(); faceid++) { x[0]=mesh.Sf()[faceid].x(); y[0]=mesh.Sf()[faceid].y(); z[0]=mesh.Sf()[faceid].z(); T[cellid]=T[cellid]-runTime.deltaTValue()*1.00*(gradT.component(0)*x[0]+gradT.component(1)*y[0]+gradT.component(2)*z[0]); } } } runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; } Info<< "End\n" << endl; return 0; } I am getting this error : error: cannot convert ‘Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >’ to ‘double’ in assignment for the line T[cellid] ... Last edited by krishna_kant_IITH; August 28, 2017 at 10:10. |
|
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Maximum number of iterations exceeded chtmultiregionsimpleFoam | Moncef | OpenFOAM Running, Solving & CFD | 28 | July 13, 2020 14:26 |
Suppress twoPhaseEulerFoam energy | AlmostSurelyRob | OpenFOAM Running, Solving & CFD | 33 | September 25, 2018 17:45 |
pimpleDyMFoam computation randomly stops | babapeti | OpenFOAM Running, Solving & CFD | 5 | January 24, 2018 05:28 |
Wrong fluctuation of pressure in transient simulation | caitao | OpenFOAM Running, Solving & CFD | 2 | March 5, 2015 21:33 |
Error while running rhoPisoFoam.. | nileshjrane | OpenFOAM Running, Solving & CFD | 8 | August 26, 2010 12:50 |