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

Calculation of gradient only for subset of cells to improve performance

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 11, 2016, 10:35
Default Calculation of gradient only for subset of cells to improve performance
  #1
Member
 
Lennart
Join Date: Feb 2016
Posts: 46
Rep Power: 10
elmo555 is on a distinguished road
Hello Foamers,

is there a way to calculate the gradient (or any other OF tensor operation) for only a subset of cells that fulfill a given condition? In my case, I need a concentration gradient Xv only near the phase interphase, that is where eps < alpha1 < 1-eps.

Since most of the cells in the domain are not close to the interface, calculating the gradient in them is a waste of computational time.

I can easily limit normal calculations to the required cells using:
Code:
forAll(alpha1, celli) {
    if(alpha1[celli] > eps && alpha1[celli] < 1-eps) {
        // ... calculation ...
    }
}
Is there a similar way for the gradient (without manually computing it - I would like to stick with the OF-implementation fvc::grad)?
elmo555 is offline   Reply With Quote

Reply

Tags
conditional, conditional computation, gradient, limit


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
Periodic flow using Cyclic - comparison with Fluent nusivares OpenFOAM Running, Solving & CFD 30 December 12, 2017 06:35
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 10:38
[ICEM] error analysis despaired student ANSYS Meshing & Geometry 7 June 27, 2012 12:57
[snappyHexMesh] snappyHexMesh aborting Tobi OpenFOAM Meshing & Mesh Conversion 0 November 10, 2010 04:23
Gradient calculation in CFD apurva shukla Main CFD Forum 1 August 21, 1998 08:05


All times are GMT -4. The time now is 12:30.