CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

postProcess: How to compute -grad?

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Yann
  • 1 Post By reverseila

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 26, 2024, 12:02
Default postProcess: How to compute -grad?
  #1
Member
 
Ali B.
Join Date: Mar 2020
Location: abzrg.github.io
Posts: 44
Rep Power: 6
reverseila is on a distinguished road
Dear all,


With postProcess -func "grad(V)" -latestTime I can compute the gradient of V (electric potential), for the latest written iteration (for a steady state simulation). However, how can I compute the multiply gradient of a field by -1?


The problem is I cannot use the following:
Code:
--> FOAM FATAL IO ERROR: (openfoam-2312)
Wrong token type - expected word, found on line 0: label -1
I'm trying to transfer the calculation of electric field from the steady state solver to one time calculation of a gradient with postProcess after simulation is done.


I would also like to give the resulting field a name. For example, when I compute grad(magSqr(V))it produces a field with the name: grad(magSqr(V)). I want to give it the name EdotGradE.


$FOAM_API: 2312
reverseila is offline   Reply With Quote

Old   July 29, 2024, 09:58
Default
  #2
Member
 
Ali B.
Join Date: Mar 2020
Location: abzrg.github.io
Posts: 44
Rep Power: 6
reverseila is on a distinguished road
To restate my problem in a simpler way, how to multiply a field by a scalar?
I think OpenFOAM foundation has a `scale` function object but it seems that OpenFOAM-ESI does not have any way to do that, as far I know.
reverseila is offline   Reply With Quote

Old   July 30, 2024, 10:24
Default
  #3
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Hello,

In the OpenCFD branch, have a look at the reference and exprFields function objects.

Regards,
Yann
reverseila likes this.
Yann is offline   Reply With Quote

Old   August 2, 2024, 17:46
Default
  #4
Member
 
Ali B.
Join Date: Mar 2020
Location: abzrg.github.io
Posts: 44
Rep Power: 6
reverseila is on a distinguished road
Thank you Yann!


I think that will do it. I will use it in the future (I wrote a new solver just for that in last few days).
Yann likes this.
reverseila is offline   Reply With Quote

Reply

Tags
postprocess


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
StarCCMS+ on AWS Parallel Cluster not distributing workload across multiple nodes dwagoner STAR-CCM+ 3 May 25, 2021 03:39
Drag Coefficient Gradient: 0 in 2d adjoint optimization tomp1993 SU2 Shape Design 11 August 1, 2019 16:14
postProcess functionality in openFOAM 4 bullmut OpenFOAM Post-Processing 23 July 21, 2017 10:11
Compute Cluster with diskless compute nodes Pauli Hardware 0 October 6, 2015 17:48
Cluster ID's not contiguous in compute-nodes domain. ??? Shogan FLUENT 1 May 28, 2014 16:03


All times are GMT -4. The time now is 14:17.