|
[Sponsors] |
[OpenFOAM] python calculator - laplacian(U) calculation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 12, 2021, 12:54 |
python calculator - laplacian(U) calculation
|
#1 |
New Member
Raoul
Join Date: Apr 2021
Posts: 16
Rep Power: 5 |
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) 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 Thanks in advance. |
|
July 14, 2021, 04:11 |
|
#2 |
New Member
Raoul
Join Date: Apr 2021
Posts: 16
Rep Power: 5 |
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]) |
|
|
|
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 |