CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

epo in mhdFoam (electric Field)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 24, 2015, 05:49
Exclamation epo in mhdFoam (electric Field)
  #1
Member
 
Muhammad Usman
Join Date: Feb 2014
Posts: 91
Rep Power: 0
13msmemusman is on a distinguished road
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
13msmemusman is offline   Reply With Quote

Reply

Tags
error, mhd, mhdfoam


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 16:28.