|
[Sponsors] |
[General] Bug? Chaining CellSize and IntegrateVariables filters leads to wrong integration |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 5, 2021, 12:06 |
Bug? Chaining CellSize and IntegrateVariables filters leads to wrong integration
|
#1 |
New Member
Allan Olesen
Join Date: Jul 2021
Posts: 1
Rep Power: 0 |
Hi, my first post here. I have a feeling that this is a bug, but I would like some input from more experienced Paraview users.
Basically, my problem is that the IntegrateVariables filter will sometimes ignore the DivideCellDataByVolume setting for a single value. Always only one value. Always the value, whose name is last in the alphabetic sort order. And only if there is a CellSize filter in the pipeline with area calculation enabled. The image below shows the result of integrating three variables named DENSITY, result1 and result2, with DivideCellDataByVolume disabled. The integration result for the three variables is the same, as it should be, because the contents of all three variable arrays are the same. (DENSITY comes from my input file, and the two other variables are created with two Calculator filters, both referring to the DENSITY variable.) The next image shows the result of a similar integration, now with DivideCellDataByVolume enabled. And now, only the results for DENSITY and _result1 are correct, while the result for _result2 is unaffected by the DivideCellDataByVolume setting. After a lot of troubleshooting and experimentation, it looks like it will only happen in some very specific circumstances:
The full calculation pipeline is shown as a Python export below. The input file is a CFD case from Fluent, which I unfortunately can't share. This pipeline extracts one fluid block from an output with multiple blocks, slices through it to create a 2D object, calculates cell areas with the CellSize filter and then adds the Calculator and IntegrateVariables filters mentioned above. Code:
# state file generated using paraview version 5.9.1 #### import the simple module from the paraview from paraview.simple import * #### disable automatic camera reset on 'Show' paraview.simple._DisableFirstRenderCameraReset() # ---------------------------------------------------------------- # setup the data processing pipelines # ---------------------------------------------------------------- # create a new 'VisItFluentReader' reader = VisItFluentReader(registrationName='reader', FileName=['C:\\tmp\\haeundae_lp1\\2052192_haeundae_LP1_ad_ver03.cas']) reader.MeshStatus = ['Mesh'] reader.CellArrayStatus = ['DENSITY'] # create a new 'Extract Block' extractBlock1 = ExtractBlock(registrationName='ExtractBlock1', Input=reader) extractBlock1.BlockIndices = [3] # create a new 'Slice' slice1 = Slice(registrationName='Slice1', Input=extractBlock1) slice1.SliceType = 'Plane' slice1.HyperTreeGridSlicer = 'Plane' slice1.SliceOffsetValues = [0.0] # init the 'Plane' selected for 'SliceType' slice1.SliceType.Origin = [2.199999942444265, 5.349999904632568, 0.0] slice1.SliceType.Normal = [0.0, 1.0, 0.0] # init the 'Plane' selected for 'HyperTreeGridSlicer' slice1.HyperTreeGridSlicer.Origin = [2.199999942444265, 5.349999904632568, 0.0] # create a new 'Cell Size' cellSize1 = CellSize(registrationName='CellSize1', Input=slice1) cellSize1.ComputeVertexCount = 0 cellSize1.ComputeLength = 0 cellSize1.ComputeVolume = 0 # create a new 'Calculator' calculator1 = Calculator(registrationName='Calculator1', Input=cellSize1) calculator1.AttributeType = 'Cell Data' calculator1.ResultArrayName = '_result1' calculator1.Function = '1.0 * DENSITY' # create a new 'Calculator' calculator2 = Calculator(registrationName='Calculator2', Input=calculator1) calculator2.AttributeType = 'Cell Data' calculator2.ResultArrayName = 'result2' calculator2.Function = '1.0 * DENSITY' # create a new 'Integrate Variables' integrateVariables_divide_disabled = IntegrateVariables(registrationName='IntegrateVariables_divide_disabled', Input=calculator2) # create a new 'Integrate Variables' integrateVariables_divide_enabled = IntegrateVariables(registrationName='IntegrateVariables_divide_enabled', Input=calculator2) integrateVariables_divide_enabled.DivideCellDataByVolume = 1 # ---------------------------------------------------------------- # restore active source SetActiveSource(integrateVariables_divide_disabled) # ---------------------------------------------------------------- if __name__ == '__main__': # generate extracts SaveExtracts(ExtractsOutputDirectory='extracts') |
|
Tags |
bug, cellsize, dividecelldatabyvolume, integratevariables, paraview |
|
|