CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Paraview & paraFoam

how to add fields in list as default?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   June 28, 2013, 04:31
Default how to add fields in list as default?
  #1
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,205
Rep Power: 17
immortality is on a distinguished road
when we open a case in paraview p and U fields are in field list without need to select them separately,how can i add T field to the list so that it be automatically available whenever i open a case in paraview?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   June 28, 2013, 15:59
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,503
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Ehsan,

This is one of those situations where there is the simple way and the complicated way

The simple way is to simply run:
Code:
paraFoam -builtin
This will tell paraFoam to use the extension ".foam" in ParaView, which means that the internal reader will be used to open the case. The controls are somewhat different, but at least all fields are loaded by default.


The complicated way requires hacking the source code:
  1. Edit the file given by the following command:
    Code:
    echo "$FOAM_UTILITIES/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfoFields.H"
  2. Find this block of code:
    Code:
            enabledEntries.setSize(2);
            enabledEntries[0] = "p";
            enabledEntries[1] = "U";
  3. Change it to this:
    Code:
            enabledEntries.setSize(3);
            enabledEntries[0] = "p";
            enabledEntries[1] = "U";
            enabledEntries[2] = "T";
  4. Save and close the file.
  5. Rebuild OpenFOAM's plug-ins for ParaView:
    Code:
    cd $FOAM_UTILITIES/postProcessing/graphics/PV3Readers
    ./Allwclean
    ./Allwmake
Two notes:
  • This hack can lead to a crash when you try to open a case that does not have the "T" field.
  • If you have got the Deb or RPM version of OpenFOAM installed, then you need to edit and rebuild the plug-ins with root powers.
Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   June 28, 2013, 16:23
Default
  #3
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,205
Rep Power: 17
immortality is on a distinguished road
Quote:
If you have got the Deb or RPM version of OpenFOAM installed, then you need to edit and rebuild the plug-ins with root powers.
Hi Bruno
How to edit the file with root power?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   June 28, 2013, 16:46
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,503
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Remember this thread: ok compile but not find the solver !
Back in April it looked like you knew how to edit files as root...
wyldckat is offline   Reply With Quote

Old   June 28, 2013, 16:51
Default
  #5
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,205
Rep Power: 17
immortality is on a distinguished road
Quote:
Originally Posted by immortality View Post
Hi Bruno
How to edit the file with root power?
I found the file you said but it can't be saved.it has only save as.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   June 28, 2013, 17:04
Default
  #6
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,503
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Quote:
Originally Posted by immortality View Post
I found the file you said but it can't be saved.it has only save as.
OK, then maybe it's better to think this the other way around:
  1. Change the permissions on the file, by running this command:
    Code:
    sudo chmod og+w "$FOAM_UTILITIES/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfoFields.H"
    This will allow you to write to the file.
  2. Modify the file with the text editor you were using and then save the file. If it gives you an error about not being to save a backup file, it doesn't matter much, because we don't need a backup.
  3. Change the permissions on the file once again, by running:
    Code:
    sudo chmod og-w  "$FOAM_UTILITIES/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfoFields.H"
Then for building, run:
Code:
sudo su -c ". $WM_PROJECT_DIR/etc/bashrc ; ./Allwclean; ./Allwmake"
wyldckat is offline   Reply With Quote

Old   June 28, 2013, 17:09
Default
  #7
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,205
Rep Power: 17
immortality is on a distinguished road
when I click on "save anyway" it doesn't take action and "don't save" button turns red again and again!
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   June 28, 2013, 17:12
Default
  #8
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,503
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Then try to change the permissions to the whole folder:
Code:
sudo chmod -R og+w "$FOAM_UTILITIES/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/"
Then after saving, undo with:
Code:
sudo chmod -R og-w "$FOAM_UTILITIES/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/"

Last edited by wyldckat; June 28, 2013 at 17:32. Reason: forgot the closing quote symbol :(
wyldckat is offline   Reply With Quote

Old   June 28, 2013, 17:25
Default
  #9
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,205
Rep Power: 17
immortality is on a distinguished road
ehsan@Ehsan-com:~$ sudo chmod -R og+w "$FOAM_UTILITIES/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/
>
Bruno the cursor blinks!and it doesn't affect!
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   June 28, 2013, 17:33
Default
  #10
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,503
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Sorry, I completely forgot about the closing quote character. I've updated the previous post with the correct code.
wyldckat is offline   Reply With Quote

Old   June 28, 2013, 17:49
Default
  #11
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,205
Rep Power: 17
immortality is on a distinguished road
thanks a lot Bruno
It works fine now.T field is added to the list automatically.I always prefer to go a long and maybe hard way at first but be relaxed later!
how do you know all these things in different areas?!
how many years are you working on your skills?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 12:44
Check particle impaction with User Fortran Julian K. CFX 3 January 12, 2012 10:46
Can not add a new user defined visualization parameter in Cut plot! george85 FloEFD, FloWorks & FloTHERM 5 November 9, 2011 14:33
Need help in Scheme Programming - Mulltiplying list elements ydan87 Fluent UDF and Scheme Programming 2 November 9, 2011 01:05
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 01:24


All times are GMT -4. The time now is 12:20.