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

uniformFixedValue with a table -> paraview doesn't show the field

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

Like Tree1Likes
  • 1 Post By lithos

Reply
 
LinkBack Thread Tools Display Modes
Old   April 9, 2014, 12:06
Default uniformFixedValue with a table -> paraview doesn't show the field
  #1
Member
 
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 33
Rep Power: 5
nlinder is on a distinguished road
Hi!

I ran an interFoam case with the velocity BC
Code:
        type            uniformFixedValue;
        uniformValue    table
        (
            (0.0 (0.0 0.0 0.0))
            (1 (1.0 0.0 0.0))
            (3 (4.0 0 0))
        );
Results are as expected. Opening the case, paraview complains
Code:
Error reading line 55 of /case/0/U: Expected a number, found (
which is the line of the first entry of the table. I read, opening it with paraFoam should resolve that issue. However, it does not for me.

Is it possible to either substitute each occurrence of that BC by a fixedValue easily (lots of timesteps)? Or does anyone know another solution? I use OF 2.2.x

Thanks in advance!
Nicklas
nlinder is offline   Reply With Quote

Old   April 10, 2014, 08:50
Default
  #2
Member
 
Nicklas Linder
Join Date: Jul 2012
Location: Germany
Posts: 33
Rep Power: 5
nlinder is on a distinguished road
managed to do it with sed:
Code:
find ./ -name U -type f -exec sed -i "/\(uniformFixedValue\)/{n;N;N;N;N;N;N;N;N;d}" {} \;
find ./ -name U -type f -exec sed -i "s/uniformFixedValue/fixedValue;value uniform (0 0 0)/g" {} \;
and yes - you might can do that in one command. But if anyone has an easier solution I'd be interested.

Greetings
nlinder is offline   Reply With Quote

Old   April 10, 2014, 15:52
Default
  #3
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Nicklas,

I'll quote myself from almost a year... er, 7 months ago:
Quote:
Originally Posted by wyldckat View Post
The internal ".foam" reader is allergic to the boundary condition "uniformFixedValue". Therefore, before running paraview, you'll need to run this command:
Code:
sed -i -e "s=uniformFixedValue=fixedValue=g"  [0-9][0-9]*/{U,p,k,nut,epsilon}
It will replace all occurrences of "uniformFixedValue" with "fixedValue", for all of the essential field files in the time folders after "0".

The problem is that you should not use these time folders for continuing the simulation afterwards, since this hack could damage the simulation characteristics for continuing simulating. But it should not damage the results for post-processing.

edit: By the way, the same happens in ParaView 3.12.0.
Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   June 10, 2014, 18:53
Default
  #4
New Member
 
yves candau
Join Date: May 2014
Posts: 4
Rep Power: 3
yvesc is on a distinguished road
thanks to you both. I have been trying to experiment with time-varying BC, and I have had the exact same problem; I am reassured that your analysis is the same as mine, it's a "bug" where openFoam files just recopy the uniformFixedValue in its entirety, and paraFoam is unable to read that format. Would be smoother and more logical if each time-file had a fixed value entry with the correct value for that time.

1) should this be reported as a bug? Doesn't just everybody meet this problem and lose time over it?

2) Bruno, your one-liner

Code:
 sed -i -e "s=uniformFixedValue=fixedValue=g"  [0-9][0-9]*/{U,p,k,nut,epsilon}
doesn't work for me:
a - "-i -e" : that has the result of generating "U-e" etc backup files -- maybe that's my version of sed, I'm on Mac OsX
b- "changing "uniformFixedValue" to "fixedValue" is not enough, you have to erase the following lines too (in my case, an inline table), otherwise paraFoam chokes.

I guess this is a job for awk, I will have to brush up on the subject.

Last edited by wyldckat; June 15, 2014 at 08:38. Reason: fixed code markers
yvesc is offline   Reply With Quote

Old   June 15, 2014, 10:53
Default
  #5
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Yves,

The problem is with ParaView's internal ".foam" reader. It is not a problem with OpenFOAM's own ".OpenFOAM" reader plug-in for ParaView.

Personally I haven't reported this to the ParaView or VTK bug tracker, as there are several more bugs that need fixing in the internal reader, which may or may not have already been fixed in the latest "vtkPOFFReader": http://openfoamwiki.net/index.php/Co...r_for_ParaView

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   July 10, 2014, 02:11
Default
  #6
New Member
 
frantov
Join Date: Nov 2011
Posts: 8
Rep Power: 5
frantov is on a distinguished road
Hello Yvesc
Did you manage to fix this with awk or something else?
Im experiencing a similar issue and I need to get rid of three tables (three outlets)
regards
Fran
frantov is offline   Reply With Quote

Old   July 16, 2014, 17:24
Default
  #7
New Member
 
yves candau
Join Date: May 2014
Posts: 4
Rep Power: 3
yvesc is on a distinguished road
Hi francisco.
No, I just gave my personal problem a quick SED treatment.


Code:
#!/bin/bash
LC_ALL=C sed -i "" -e "/uniformFixedValue/{n;N;N;N;N;N;N;N;N;d;}" [0-9][0-9]*/Solid2/T
LC_ALL=C sed -i "" -e "s/uniformFixedValue/fixedValue; value uniform 300/g" [0-9][0-9]*/Solid2/T
in my case, the files to modify were T in directories xxxxxx/Solid2 except of course directory 0, hence the first [0-9] in the path.
The first line deletes the lines after uniformFixedValue; the number of N's had to be adapted to the number of lines to be deleted *in my case*.
The second line replaces the remaining "uniformFixedValue" by "fixed value".
The "" after -i was necessary to remove the problem I pointed out in my previous post.

LC_ALL=C was necessary to avoid an "illegal byte sequence" error, my files probably are not UTF8, didn't check.
yvesc is offline   Reply With Quote

Old   November 19, 2014, 07:39
Default
  #8
New Member
 
Michael
Join Date: Dec 2011
Location: Geneva
Posts: 28
Rep Power: 5
lithos is on a distinguished road
Quote:
Originally Posted by yvesc View Post
maybe that's my version of sed, I'm on Mac OsX
Hi,

yes, this is exactly the problem. I would suggest you to install gsed via MacPorts, Fink, or any other source you might want to use. Standard 'sed' by Apple is a weird, limited edition. I had already several problems using linux scripts on Mac due to this. Hope it helps.

Cheers, Michael
wyldckat likes this.
lithos 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
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
Paraview Vector Field simone Marras ParaView 2 April 3, 2013 06:34
Show pressure field as pressure/dynamic pressure ozzythewise OpenFOAM Post-Processing 1 July 13, 2010 10:00
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51
How to get value scale of field in ParaView kar OpenFOAM Paraview & paraFoam 0 February 26, 2008 14:15


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