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

Accessing Inter-cell convection

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 25, 2024, 09:26
Default Accessing Inter-cell convection
  #1
Member
 
Sereff
Join Date: Jan 2019
Posts: 48
Rep Power: 7
Sereff is on a distinguished road
Dear Foamers,

I am working on a solver for a chemical reaction.
Code:
fvScalarMatrix YiEqn
(
    fvm::ddt(Yi)
  + fvm::div(phi, Yi)
  - fvm::laplacian(Deff, Yi)
 ==
    fvOptions(Yi)
  + reaction->R(i)
);
And for one of the reactions, in order to calculate the source term R(i), I would need the information of the convection of the species of each cell with its surrounding cells and boundaries. I am aware that there's
Code:
fvm::div(phi, Yi)
but I need the information as a volScalarField or GeometricField<scalar>. And the adorementioned term is operating on a fvScalarMatrix, which contains a lot more information and I am not sure how to extract the information i want. Could someone help me on this issue?

kind regards,
Sereff is offline   Reply With Quote

Old   March 25, 2024, 13:39
Default
  #2
Member
 
Shravan
Join Date: Mar 2017
Posts: 63
Rep Power: 9
Severus is on a distinguished road
Hello,
You can use fvc instead.
For example the continuity error is calculated in a similar fashion
Code:
 volScalarField contErr(fvc::div(phi));
See line 33: https://cpp.openfoam.org/v9/src_2fin...8H_source.html

Thanks
Severus is offline   Reply With Quote

Old   March 26, 2024, 11:21
Default
  #3
Member
 
Sereff
Join Date: Jan 2019
Posts: 48
Rep Power: 7
Sereff is on a distinguished road
Thank you Severus, and I guess if I use
Code:
fvc::div(phi,Yi)
then it would give me the convection of species Yi for all cells?

kind regards,
Sereff is offline   Reply With Quote

Old   March 27, 2024, 10:32
Default
  #4
Member
 
Shravan
Join Date: Mar 2017
Posts: 63
Rep Power: 9
Severus is on a distinguished road
Hello,
Yes you should get whole field values (i.e. for all cells).

Thanks
Severus is offline   Reply With Quote

Reply


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
Accessing local cell index with global cell index in functionObject Shibi OpenFOAM Programming & Development 2 May 18, 2021 11:16
how to evaluate where UDM is failing tricha122 FLUENT 4 June 18, 2020 13:45
accessing internal cell gradient field at boundary when applying boundary condition vishalsacharya OpenFOAM Programming & Development 7 February 25, 2019 15:36
Accessing neighboring cells' cell number Daniel Lattin Siemens 4 October 20, 2006 16:19
Accessing Neighbouring Cell info Murali Siemens 1 December 9, 2002 06:10


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