|
[Sponsors] |
December 24, 2015, 05:49 |
epo in mhdFoam (electric Field)
|
#1 |
Member
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0 |
Hi Foamers i was trying to implement following code in openFoam
Info<< nl << "Starting time loop" << endl; while (runTime.loop()) { #include "readPISOControls.H" #include "readBPISOControls.H" Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"<< " ClockTime = " << runTime.elapsedClockTime() << " s"<< nl << endl; #include "CourantNo.H" { volVectorField UcrosB= U ^ B; volVectorField j=-sigma*fvc::grad(epo) + sigma*UcrosB; volVectorField jcrosB = j ^ B; fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) - (jcrosB/rho) - fvm::laplacian(nu, U) ); UEqn.relax(); solve(UEqn == -fvc::grad(p)); // --- PISO loop for (int corr=0; corr<nCorr; corr++) { p.storePrevIter(); volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); phi = (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rAU, U, phi); 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(); } p.relax(); } #include "continuityErrs.H" U -= rAU*fvc::grad(p); U.correctBoundaryConditions(); } } // --- B-PISO loop for (int Bcorr=0; Bcorr<nBcorr; Bcorr++) { volVectorField UcrosB= U ^ B; fvScalarMatrix BEqn ( fvm::laplacian(epo) - fvc::div(UcrosB) ); BEqn.solve(); // #include "magneticFieldErr.H" } runTime.write(); } Info<< "End\n" << endl; return 0; } The Solver gives me following errors mhdFoamModified.C:78:35: error: ‘epo’ was not declared in this scope volVectorField j=-sigma*fvc::grad(epo) + sigma*UcrosB; ^ mhdFoamModified.C:96:3: error: ‘ddtPhiCorr’ is not a member of ‘Foam::fvc’ + fvc::ddtPhiCorr(rAU, U, phi); ^ mhdFoamModified.C:122:16: error: ‘epo’ was not declared in this scope fvm::laplacian(epo) - fvc::div(UcrosB) ^ In file included from mhdFoamModified.C:70:0: /opt/openfoam231/src/finiteVolume/lnInclude/readPISOControls.H:3:15: warning: unused variable ‘nOuterCorr’ [-Wunused-variable] const int nOuterCorr = ^ /opt/openfoam231/src/finiteVolume/lnInclude/readPISOControls.H:12:16: warning: unused variable ‘momentumPredictor’ [-Wunused-variable] const bool momentumPredictor = ^ /opt/openfoam231/src/finiteVolume/lnInclude/readPISOControls.H:15:16: warning: unused variable ‘transonic’ [-Wunused-variable] const bool transonic = ^ In file included from createFields.H:96:0, from mhdFoamModified.C:62: createPhiB.H:47:25: warning: unused variable ‘phiB’ [-Wunused-variable] surfaceScalarField& phiB = *phiBPtr; ^ make: *** [Make/linuxGccDPOpt/mhdFoamModified.o] Error 1 Please help me i got this code from following link http://www.woodruffscientific.com/files/hcll2Report.pdf |
|
Tags |
error, mhd, mhdfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Foam::error::PrintStack | almir | OpenFOAM Running, Solving & CFD | 92 | May 21, 2024 08:56 |
BCs and correctBoundaryConditions() for an electric field and current solver | chriss85 | OpenFOAM Programming & Development | 4 | May 3, 2022 13:29 |
problems after decomposing for running | alessio.nz | OpenFOAM | 7 | March 5, 2021 05:49 |
''unknown radialModelType type Gidaspow'' PROBLEM WITH THE BED TUTORIAL | AndoniBM | OpenFOAM Running, Solving & CFD | 2 | March 25, 2015 19:44 |
modeling electric field in a flow | amajburi | CFX | 0 | August 10, 2011 03:50 |