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

how to extract value from the previous node

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 25, 2021, 07:44
Question how to extract value from the previous node
  #1
Senior Member
 
Kumaresh
Join Date: Oct 2016
Posts: 349
Rep Power: 11
Kummi is on a distinguished road
Send a message via Yahoo to Kummi
Hello Foamers,
In my source file (.C), the following segment of code is introduced for 1D problem.
Quote:
if ((T_[cellI] == scalar(100.0)) && (alpha_[cellI] > scalar(0.0)))
{
const Foam::List<int> neigbhorcellI = regionMesh().cellCells(cellI);
forAll(neigbhorcellI, I)
{
if (regionMesh().cellCentres()[I][0] < regionMesh().cellCentres()[cellI][0])
{
QB_[cellI] = K_[I]* ((T_[I] - 100) /0.002); -- > (1)
break ;
}
}
}
In Equ (1), the values of K and T are extracted from previous node and its works fine.

For some reason, I need to implement the above set of code once again in my customized thermo package file (similar location below).
https://github.com/OpenFOAM/OpenFOAM...s/solid/thermo
Here in my thermo package file, I have no idea as how to implement Equ (1) by accessing values from previous node because, there are no arguments to ‘regionMesh’ that depend on a template parameter.

Kindly someone guide me out here.
Thank you
Kummi 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
How to access the value from previous node (cell) Kummi OpenFOAM 1 July 27, 2020 11:00
Grid Motion Global Node Address Issue buckngnr11 Fluent UDF and Scheme Programming 1 April 24, 2020 07:44
Running on 4 node error MPI Errors[320798736] tailele STAR-CCM+ 4 April 2, 2020 04:59
Difference between mesh created from Operations node and Continua node granzer STAR-CCM+ 2 November 18, 2019 04:38
Host Node Allocation (-ssh and -cx) on Linux HPC bloodflow FLUENT 3 October 10, 2019 10:46


All times are GMT -4. The time now is 06:00.