在lagrangian/intermediate/submodels/Kinematic/ParticleForces路径下添加了一个电场力模型,编译通过,case计算时报错,似乎跟q和E变量未初始化有关,代码小白,求指点。
563ac197-796b-4021-a867-d6ecd3a34007-image.png
648c605a-93af-4ff6-9178-8242e48f84bd-image.png
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::ElectricfieldForce<CloudType>::ElectricfieldForce
(
CloudType& owner,
const fvMesh& mesh,
const dictionary& dict,
const word& forceType,
const volScalarField& qField
)
:
ParticleForce<CloudType>(owner, mesh, dict, forceType, true),
EName_(this->coeffs().template lookupOrDefault<word>("E", "E")),
EInterpPtr_(NULL),
qField_(qField)
{
Info<< "-----p in ELe\n" << endl;
qInterpPtr_.reset
(
interpolation<scalar>::New
(
owner.solution().interpolationSchemes(),
qField
).ptr()
);
Info<< "-----p2 in ELe\n" << endl;
}
template<class CloudType>
Foam::ElectricfieldForce<CloudType>::ElectricfieldForce
(
const ElectricfieldForce& etf
)
:
ParticleForce<CloudType>(etf),
EName_(etf.EName_),
EInterpPtr_(NULL),
qField_(etf.qField_)
{}