CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[OpenFOAM] python calculator - laplacian(U) calculation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 12, 2021, 12:54
Default python calculator - laplacian(U) calculation
  #1
New Member
 
Raoul
Join Date: Apr 2021
Posts: 16
Rep Power: 5
rol97 is on a distinguished road
Hi everyone,
I am currently trying to evaluate through python calculator the laplacian of U, however such function only takes as input scalars. I wanted thus to write something similar to
Code:
laplacian(U_X)
however I cannot make it work, and I get this error message.
Code:
  File "/opt/paraviewopenfoam56/lib/python2.7/site-packages/paraview/calculator.py", line 192, in execute
    retVal = compute(inputs, expression, ns=variables)
  File "/opt/paraviewopenfoam56/lib/python2.7/site-packages/paraview/calculator.py", line 140, in compute
    retVal = eval(expression, globals(), mylocals)
  File "<string>", line 1, in <module>
NameError: name 'U_X' is not defined
Do you have any suggestion on how to evaluate such term?
Thanks in advance.
rol97 is offline   Reply With Quote

Old   July 14, 2021, 04:11
Default
  #2
New Member
 
Raoul
Join Date: Apr 2021
Posts: 16
Rep Power: 5
rol97 is on a distinguished road
Nevermind, I figured it out, it is probably basic knowledge but I will explain anyway.
The syntax to extract the single component from the vector and evaluate the laplacian is

Code:
laplacian(U[:,0])
rol97 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
[PyFoam] Using pyFoamPlotWatcher.py To Plot Residuals m_ridzon OpenFOAM Community Contributions 22 January 26, 2021 18:48
Transfer output data as input for second calculation mannobot Main CFD Forum 3 December 7, 2018 09:37
Determining the calculation sequence of the regions in multe regions calculation peterhess OpenFOAM Running, Solving & CFD 4 March 9, 2016 03:07
Quick Question on Calculation Time Davitt COMSOL 0 January 14, 2016 14:16
Heat Flux Calculation under REPORTS Alberto Schroth FLUENT 0 May 16, 2000 08:19


All times are GMT -4. The time now is 23:35.