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

Accessing species in coded function object

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 23, 2022, 09:01
Default Accessing species in coded function object
  #1
Member
 
Join Date: Jun 2020
Posts: 49
Rep Power: 5
Swirl is on a distinguished road
Hi everyone,
I am currently writing a coded function object for the reactingFoam solver. For the application I need to access the species. In the solver code this can be done by

Code:
forAll(Y, i){
doWhatever();
}
However, when using these expressions in the coded function object, I get an error saying that Y has not been defined. Can anyone help me figure out, how to access the species from a coded function object?

Thank you very much in advance!
Swirl is offline   Reply With Quote

Old   January 23, 2022, 13:08
Default Additional problem
  #2
Member
 
Join Date: Jun 2020
Posts: 49
Rep Power: 5
Swirl is on a distinguished road
There appeared another problem when creating an IOdictionary. For the Following code

Code:
IOdictionary reactions
(
     IOobject(
          "reactions",
          runTime.constant(),
          mesh,
          IOobject::MUST_READ,
          IOobject::NO_WRITE
     )
);
I get an Error saying, that "runTime" was not defined in this scope. Please help me, I don't know much about coding.
Swirl is offline   Reply With Quote

Old   January 24, 2022, 04:52
Default
  #3
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 736
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Not sure.

Possibly looking into codedFunctionObject documented here https://www.openfoam.com/documentati...ionObject.html

Inside the codedFunctionObject you should be able to use forAll as intended.

Likely you will need to distinguish between fuel, oxidizer, product and inert species. This information is stored in the thermo.composition object
dlahaye is offline   Reply With Quote

Reply

Tags
coded functions, species


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
whats the cause of error? immortality OpenFOAM Running, Solving & CFD 13 March 24, 2021 07:15
[mesh manipulation] refineMesh Error mohsen.boojari OpenFOAM Meshing & Mesh Conversion 3 March 1, 2018 22:07
[snappyHexMesh] Problem with parallel run of snappyHexMesh Lorenzo92 OpenFOAM Meshing & Mesh Conversion 5 April 15, 2016 04:12
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 07:36
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 06:51


All times are GMT -4. The time now is 15:26.