|
[Sponsors] | |||||
|
|
|
#1 | |
|
New Member
Hamed Hoorijani
Join Date: May 2019
Location: Gent, Belgium
Posts: 23
Rep Power: 8 ![]() |
Hi everyone,
I am receiving errors regarding two volScalarFields while running my own solver. It's strange to me that only these two variables are causing errors, considering I have defined and worked with other variables in the code without any issues during solver execution. Additionally, I should mention that the solver compiles without any errors or warnings. It's a coupling solver with LIGGGHTS (CFD-DEM), but I'm encountering this error prior to the coupling initiation at each CFD time-step. I am confused why I am getting error just for these two variables, I would appreciate it if anyone can help me. Error: Quote:
Code:
volScalarField cellQj
(
IOobject
(
"cellQj",
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar(dimPower, Zero)
);
volScalarField Qaj
(
IOobject
(
"Qaj",
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar(dimPower, Zero)
);
Code:
imensionedScalar tempValue = sqrt(coilElectricalResis/(relParticleMagPer* particleElectricalResis));
dimensionedScalar elecEfficiency = 1/(1 + (Di/Do) * tempValue);
forAll(emfVec,celli)
{
Qaj[celli] = (pow(mag(emfVec[celli]),2)/particleElectricalResis.value())+ SMALL;
}
cellQj= Qaj/(elecEfficiency * thermalEfficiency);
runTime.write();
|
||
|
|
|
||
|
|
|
#2 |
|
New Member
Vinayak Ramachandran
Join Date: Jan 2024
Posts: 10
Rep Power: 4 ![]() |
Hello Hamedhoorijani,
Not sure this will help, but in your definition of the fields one line seems to be missing; the mesh.time().timeName() parameter inside the IOobject. As per the coding guidelines (https://develop.openfoam.com/Develop...terns/registry) new field definition format is as follows: fieldPtr = new volScalarField ( IOobject ( objectName, mesh.time().timeName(), mesh.thisDb(), IOobject::NO_READ, IOobject::NO_WRITE // implicit: IOobject::REGISTER ), mesh, dimensionedScalar(dimless, Zero) // implicit: calculatedType() ); |
|
|
|
|
|
|
|
|
#3 | |
|
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 41 ![]() ![]() |
Quote:
Good answer, BTW. |
||
|
|
|
||
|
|
|
#4 |
|
New Member
Hamed Hoorijani
Join Date: May 2019
Location: Gent, Belgium
Posts: 23
Rep Power: 8 ![]() |
Dear Vinayak and Mark,
Thank you for your reply. Overlooking those lines was indeed the cause of errors that I was getting. It is solved now. |
|
|
|
|
|
![]() |
| Tags |
| coding, openfoam 8, programming |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Other] mesh airfoil NACA0012 | anand_30 | OpenFOAM Meshing & Mesh Conversion | 13 | March 7, 2022 18:22 |
| [CGNS] CGNS converters available | mbeaudoin | OpenFOAM Meshing & Mesh Conversion | 137 | December 14, 2018 05:20 |
| [mesh manipulation] refineMesh Error | mohsen.boojari | OpenFOAM Meshing & Mesh Conversion | 3 | March 1, 2018 23:07 |
| simpleFoam parallel | AndrewMortimer | OpenFOAM Running, Solving & CFD | 12 | August 7, 2015 19:45 |
| [blockMesh] error message with modeling a cube with a hold at the center | hsingtzu | OpenFOAM Meshing & Mesh Conversion | 2 | March 14, 2012 10:56 |