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

Foam Serious Error while running solver

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 2 Post By VRN
  • 1 Post By olesen

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 4, 2024, 06:32
Question Foam Serious Error while running solver
  #1
New Member
 
Hamed Hoorijani
Join Date: May 2019
Location: Gent, Belgium
Posts: 22
Rep Power: 6
Hamedhoorijani is on a distinguished road
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:
[0] --> FOAM Serious Error :
[0] From function virtual bool Foam::regIOobject::writeObject(Foam::IOstream::str eamFormat, Foam::IOstream::versionNumber, Foam::IOstream::compressionType, bool) const
[0] in file db/regIOobject/regIOobjectWrite.C at line 55
[0] instance undefined for object Qaj
[3] --> FOAM Serious Error :
[3] From function virtual bool Foam::regIOobject::writeObject(Foam::IOstream::str eamFormat, Foam::IOstream::versionNumber, Foam::IOstream::compressionType, bool) const
[3] in file db/regIOobject/regIOobjectWrite.C at line 55
[3] instance undefined for object cellQj
Defining Qaj and cellQj:
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: (all the variables are dimensionedScalar in this code snippet and emfVec is a vector field.
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();
Hamedhoorijani is offline   Reply With Quote

Old   April 16, 2024, 09:56
Default
  #2
VRN
New Member
 
Vinayak Ramachandran
Join Date: Jan 2024
Posts: 3
Rep Power: 2
VRN is on a distinguished road
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()
);
olesen and Hamedhoorijani like this.
VRN is offline   Reply With Quote

Old   April 16, 2024, 11:04
Default
  #3
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,686
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by VRN View Post
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.
Most definitely this is the cause. If you have called it with a single parameter (eg, "fieldName") the only constructor it knows about takes a fileName, which it tries to split into components (it splits on the '/' slashes).


Good answer, BTW.
Hamedhoorijani likes this.
olesen is offline   Reply With Quote

Old   April 17, 2024, 04:23
Default
  #4
New Member
 
Hamed Hoorijani
Join Date: May 2019
Location: Gent, Belgium
Posts: 22
Rep Power: 6
Hamedhoorijani is on a distinguished road
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.
Hamedhoorijani is offline   Reply With Quote

Reply

Tags
coding, openfoam 8, programming


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
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 17:22
[CGNS] CGNS converters available mbeaudoin OpenFOAM Meshing & Mesh Conversion 137 December 14, 2018 04:20
[mesh manipulation] refineMesh Error mohsen.boojari OpenFOAM Meshing & Mesh Conversion 3 March 1, 2018 22:07
simpleFoam parallel AndrewMortimer OpenFOAM Running, Solving & CFD 12 August 7, 2015 18:45
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 09:56


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