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

query for variable cell limit

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   October 2, 2017, 03:43
Default query for variable cell limit
  #1
New Member
 
A Z
Join Date: Dec 2015
Posts: 15
Rep Power: 4
don6alfonso is on a distinguished road
hey foamers,

I made a new solver based on scalarTransportFoam. I added a source term M0.

My problem:
The variable T (from scalarTransportFoam) exceeds the cell value of the source term M0. The source term value should be the maximum value.

My idea:
a query if T lager then M0 (in every cell). If its true set T=M0.

I find here this:
limit variable

I want to do it like this way in the simple.loop() of my .c
Code:
forAll(mesh.cellZones(), zoneI)
{
    const cellZone& cz = mesh.cellZones()[zoneI];
    const labelList& cells = cz;

 
forAll(mesh.cellZones(), zoneI)
{
    const cellZone& cz = mesh.cellZones()[zoneI];
    const labelList& cells = cz;

 
forAll(cells, iCells)
{
    const label cellId = cells[iCells];
            
    if (T()[cellId] > M0()[cellId])
    {
    T()[cellId] = M0()[cellId];
    }
}
}
}
but it didnt complie. I think the query is wrong.

Can anyone help me?
Best regards
don6alfonso is offline   Reply With Quote

Reply

Tags
limit, variable

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compute/Extract cell wall distance Ionut G Fluent UDF and Scheme Programming 0 March 23, 2017 08:05
How to use "translation" in solidBodyMotionFunction in OpenFOAM rupesh_w OpenFOAM Running, Solving & CFD 5 August 16, 2016 04:27
2 datas on one plot Akuji ParaView 46 December 1, 2013 15:06
monitoring cell Jane Siemens 2 March 4, 2004 22:01
cell to cell relation CMB Siemens 1 December 4, 2003 05:05


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