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

postProcess -field U -func mag, Why it gives error?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 9, 2020, 13:39
Wink postProcess -field U -func mag, Why it gives error?
  #1
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 16
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Hi guys.

Ok, I already know that I can use the following code and compute the mag of U easily:

Code:
postProcess -func "mag(U)"
There is a big but here. Checkout this command:

Code:
postProcess -fields "(p U)" -func wallShearStress
It is mentioned in the OpenFOAM user guide and it works just fine. I guess you guess what my question is now; why I cannot get the mag of U by the following command:

Code:
postProcess -field U -func mag
It gives me the following error:

Code:
Time = 1

Reading fields:
    volVectorFields: U

Executing functionObjects
--> FOAM Warning :     functionObjects::mag mag cannot find required object <fieldName> of type volScalarField
--> FOAM Warning :     functionObjects::mag mag cannot find required object <fieldName> of type surfaceScalarField
--> FOAM Warning :     functionObjects::mag mag cannot find required object <fieldName> of type volVectorField
--> FOAM Warning :     functionObjects::mag mag cannot find required object <fieldName> of type surfaceVectorField
--> FOAM Warning :     functionObjects::mag mag cannot find required object <fieldName> of type volSphericalTensorField
--> FOAM Warning :     functionObjects::mag mag cannot find required object <fieldName> of type surfaceSphericalTensorField
--> FOAM Warning :     functionObjects::mag mag cannot find required object <fieldName> of type volSymmTensorField
--> FOAM Warning :     functionObjects::mag mag cannot find required object <fieldName> of type surfaceSymmTensorField
--> FOAM Warning :     functionObjects::mag mag cannot find required object <fieldName> of type volTensorField
--> FOAM Warning :     functionObjects::mag mag cannot find required object <fieldName> of type surfaceTensorField
--> FOAM Warning :     functionObjects::mag mag failed to execute.
What are the differences?

Cheers & Stay Healthy!
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   April 9, 2020, 15:08
Default
  #2
Senior Member
 
zhangyan's Avatar
 
Yan Zhang
Join Date: May 2014
Posts: 120
Rep Power: 12
zhangyan is on a distinguished road
You need a configuration file in the system directory, like this:
https://github.com/OpenFOAM/OpenFOAM...ing/fields/mag
change the <fieldName> to U

and then:
Code:
postProcess -func mag -field U
finally, you will get mag(U) in the $time directory.
__________________
https://openfoam.top
zhangyan is offline   Reply With Quote

Old   April 9, 2020, 15:16
Default
  #3
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 16
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by zhangyan View Post
You need a configuration file in the system directory, like this:
https://github.com/OpenFOAM/OpenFOAM...ing/fields/mag
change the <fieldName> to U

and then:
Code:
postProcess -func mag -field U
finally, you will get mag(U) in the $time directory.
Thank Yan,

But I already have the configuration file in the OpenFOAM caseDicts directory. However, I copied the file into my system folder too:

Code:
foamGet mag
I tried the command but again the same error happened.

Cheers
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   April 9, 2020, 15:18
Default
  #4
Senior Member
 
zhangyan's Avatar
 
Yan Zhang
Join Date: May 2014
Posts: 120
Rep Power: 12
zhangyan is on a distinguished road
Don't forget to change the <fieldName> to U
__________________
https://openfoam.top
zhangyan is offline   Reply With Quote

Old   April 9, 2020, 15:21
Default
  #5
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 16
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by zhangyan View Post
Don't forget to change the <fieldName> to U
Yea, that did the trick. Thanks!

However, I get two warnings whenever I try to compute mag(U) field using any method. Do you know why?

Code:
Time = 1

Reading fields:
    volVectorFields: U

Executing functionObjects
--> FOAM Warning :     functionObjects::mag mag cannot find required object U of type volScalarField
--> FOAM Warning :     functionObjects::mag mag cannot find required object U of type surfaceScalarField
    functionObjects::mag mag writing field: mag(U)
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   April 9, 2020, 15:22
Default
  #6
Senior Member
 
zhangyan's Avatar
 
Yan Zhang
Join Date: May 2014
Posts: 120
Rep Power: 12
zhangyan is on a distinguished road
Me too. Just forget it.
__________________
https://openfoam.top
zhangyan 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
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch gschaider OpenFOAM Installation 225 August 25, 2015 20:43
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
Ansys Fluent 13.0 UDF compilation problem in Window XP (32 bit) Yogini Fluent UDF and Scheme Programming 7 October 3, 2012 08:24
CGNS lib and Fortran compiler manaliac Main CFD Forum 2 November 29, 2010 07:25
Installation OF1.5-dev ttdtud OpenFOAM Installation 46 May 5, 2009 03:32


All times are GMT -4. The time now is 02:40.