This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/electromagnetics/mhdFoam/createPhiB.H

48 lines
959 B
C++
Raw Normal View History

IOobject phiBHeader
(
"phiB",
runTime.timeName(),
mesh,
IOobject::NO_READ
);
surfaceScalarField* phiBPtr;
if (phiBHeader.headerOk())
{
Info<< "Reading field phiB\n" << endl;
phiBPtr = new surfaceScalarField
(
IOobject
(
"phiB",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
}
else
{
Info<< "Calculating face flux\n" << endl;
phiBPtr = new surfaceScalarField
(
IOobject
(
"phiB",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
(fvc::interpolate(B) & mesh.Sf())
);
}
surfaceScalarField& phiB = *phiBPtr;