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

[OpenFOAM] how to add fields in list as default?

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

Reply
 
LinkBack Thread Tools Search this Thread 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,208
Rep Power: 26
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
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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,208
Rep Power: 26
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
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Remember this thread: http://www.cfd-online.com/Forums/ope...nd-solver.html
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,208
Rep Power: 26
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
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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,208
Rep Power: 26
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
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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,208
Rep Power: 26
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
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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,208
Rep Power: 26
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 Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] Installation Problem with OF 6 version Aurel OpenFOAM Community Contributions 14 November 18, 2020 16:18
[swak4Foam] swak4Foam-groovyBC build problem zxj160 OpenFOAM Community Contributions 18 July 30, 2013 13:14
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 10:57
CFX-Pre problem, pls help!!! cth_yao CFX 0 February 17, 2012 00:52
PostChannel maka OpenFOAM Post-Processing 5 July 22, 2009 09:15


All times are GMT -4. The time now is 21:34.