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

How to visualize the difference of fields btween two simulation

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

Like Tree3Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   August 16, 2013, 06:43
Default How to visualize the difference of fields btween two simulation
  #1
Member
 
MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
msarkar is on a distinguished road
Hi Foamers,
Could you please tell me how to visualize the difference of fields (T, U etc.) between two OF simulations using Paraview? Same mesh used for both.

Thanks in advance.
msarkar is offline   Reply With Quote

Old   August 16, 2013, 06:52
Default
  #2
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
Bernhard is on a distinguished road
I would just copy some files for the cases you want to compare and then use foamCalc.

You can subtract two fields by
Code:
foamCalcEx addSubtract field1 subtract -field field2
Bernhard is offline   Reply With Quote

Old   August 16, 2013, 06:58
Default
  #3
Member
 
MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
msarkar is on a distinguished road
Quote:
Originally Posted by Bernhard View Post
I would just copy some files for the cases you want to compare and then use foamCalc.

You can subtract two fields by
Code:
foamCalcEx addSubtract field1 subtract -field field2
Hi Bernhard,
Thanks a lot for your quick reply. Could you please tell me in little details. Suppose I have two cases (case1 & case2) and I want to compare T and U between case 1 & case2. How do I proceed?
msarkar is offline   Reply With Quote

Old   August 16, 2013, 07:03
Default
  #4
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
Bernhard is on a distinguished road
Well, easiest is to copy T en U from case 1 to case 2 (but with a different name), especially if you want to do this only once, it is a quick and dirty solution.
Bernhard is offline   Reply With Quote

Old   August 16, 2013, 07:34
Default
  #5
Member
 
MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
msarkar is on a distinguished road
Thanks Bernhard, I will try this.
msarkar is offline   Reply With Quote

Old   August 16, 2013, 08:01
Default
  #6
Member
 
MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
msarkar is on a distinguished road
Hi Bernhard,

I did the followings and got error. Please let me know what I am missing.

My cases are multi region case. I copied latest T from case2 to case1 in corresponding regions with name T_reg1, T_reg2 and T_reg3 in the latest time directory. The tried the following commands and every time getting error.

foamCalc addSubtract T subtract -T T_reg1 -region reg1 -latestTime
foamCalc addSubtract T subtract T_reg1 -region reg1 -latestTime
foamCalc -region reg1 -latestTime addSubtract T subtract -T T_reg1
foamCalc addSubtract -region reg1 -latestTime T subtract -T T_reg1
msarkar is offline   Reply With Quote

Old   August 16, 2013, 08:03
Default
  #7
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
Bernhard is on a distinguished road
Instead of -T and -region use always -field. I'm sorry if this was unclear.
Bernhard is offline   Reply With Quote

Old   August 19, 2013, 08:19
Default
  #8
Member
 
MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
msarkar is on a distinguished road
Hi Bernhard,

Thanks a lot for your help. Finally it worked.
msarkar is offline   Reply With Quote

Old   August 21, 2013, 05:21
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
Hi all
I want to compare p fields between two similar time's of two successive cycles in my case to see if the solution has converged well or not yet,how to do what has told here only for one case in different times?
__________________
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   August 30, 2013, 07:06
Default
  #10
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,205
Rep Power: 17
immortality is on a distinguished road
this error occurred when I wanted to have access to help:
Code:
ehsan@Ehsan-com:~$ foamCalcEx -help
foamCalcEx: command not found
ehsan@Ehsan-com:~$ foamCalcEx --help
foamCalcEx: command not found
ehsan@Ehsan-com:~$ foamCalcEX --help
foamCalcEX: command not found
ehsan@Ehsan-com:~$ foamCalcEX addSubtract --help
foamCalcEX: command not found
ehsan@Ehsan-com:~$
__________________
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   August 31, 2013, 12:46
Default
  #11
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,511
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,

foamCalc is one of the few applications in OpenFOAM that do not respond directly to help requests
This is due to how it was designed to work, namely it first must strictly receive the name of the operation name for the calculation. For example, these two commands should work for getting help:
Code:
foamCalc -help
foamCalc addSubtract -help
The first one indicates which operators exist and the second one gives the help for this operation.

For additional help reference on how to use these kinds of applications:


In particular to your problem about foamCalcEx, I believe there is a thread where building it is discussed... well, not exactly dedicated to it, but here it is: volum integral of mag(U)...?



Best regards,
Bruno
minaret likes this.
wyldckat is offline   Reply With Quote

Old   August 31, 2013, 15:35
Default
  #12
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,205
Rep Power: 17
immortality is on a distinguished road
Hi Bruno
thanks,but whats foamCalcEx?
Quote:
I would just copy some files for the cases you want to compare and then use foamCalc.

You can subtract two fields by
Code:
foamCalcEx addSubtract field1 subtract -field field2
Code:
ehsan@Ehsan-com:~$ foamCalcEx addSubtract -help
foamCalcEx: command not found
ehsan@Ehsan-com:~$ foamCalcEx -help
foamCalcEx: command not found
and how I have to use options for one field in two times of one case?how to use -time option?
__________________
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   August 31, 2013, 16:02
Default
  #13
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,205
Rep Power: 17
immortality is on a distinguished road
the link for download is banned!
http://openfoamwiki.net/index.php/Co...amCalcEx#Usage
Code:
ehsan@Ehsan-com:~$ hg clone https://code.google.com/p/foamcalcex/
abort: HTTP Error 403: Forbidden
is there another way to download it?
__________________
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   August 31, 2013, 16:12
Default
  #14
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,511
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Doesn't work for the same reason has you mentioned here: http://www.cfd-online.com/Forums/ope...tml#post443306 - post #59

But this is a good opportunity to see if you can download from the correct location. Try these two possibilities:
  • While still using hg, run without the HTTPS connection and use HTTP:
    Code:
    hg clone http://code.google.com/p/foamcalcex/
  • Or try the download from the zip snapshot:
    Code:
    wget http://foamcalcex.googlecode.com/archive/tip.zip
With any luck, at least of these still work.
wyldckat is offline   Reply With Quote

Old   August 31, 2013, 16:28
Default
  #15
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,the second way answered well:
Code:
ehsan@Ehsan-com:~$ hg clone http://code.google.com/p/foamcalcex/
abort: HTTP Error 403: Forbidden
ehsan@Ehsan-com:~$ wget http://foamcalcex.googlecode.com/archive/tip.zip
--2013-09-01 00:56:36--  http://foamcalcex.googlecode.com/archive/tip.zip
Resolving foamcalcex.googlecode.com... 173.194.70.82, 2a00:1450:4001:c02::52
Connecting to foamcalcex.googlecode.com|173.194.70.82|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-compressed]
Saving to: `tip.zip'

    [                        <=>            ] 95,283      4.46K/s   in 22s     

2013-09-01 00:57:02 (4.26 KB/s) - `tip.zip' saved [95283]
now what should I do to compile it?it has downloaded in another place except to downolads folder.
__________________
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   August 31, 2013, 16:54
Default
  #16
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,511
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
I've updated the wiki page. Check the updated build instructions: http://openfoamwiki.net/index.php/Co...alcEx#Download
wyldckat is offline   Reply With Quote

Old   August 31, 2013, 17:05
Default
  #17
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, I wonder how code.google worked altough that's good!
I have to use sudo?
Code:
ehsan@Ehsan-com:~/foamcalcex-2c7dd0c903db$ ./Allwmake
~/foamcalcex-2c7dd0c903db/postProcessing ~/foamcalcex-2c7dd0c903db
./Allwmake: line 5: ./Allwmake: Permission denied
__________________
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   August 31, 2013, 17:14
Default
  #18
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,511
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Ooops, I forgot to test the commands myself... there was a file missing from the chmod command line... the fixed one is:
Code:
chmod +x Allwmake postProcessing/Allwmake

As for googlecode.com vs code.google.com: if I'm not mistaken, the problem is that "code.google.com" switches to HTTPS by default, and HTTPS apparently is banned in your country.
But "googlecode.com" does not rely on HTTPS to work, so you can download files from the Google Code repositories from that server.
immortality likes this.
wyldckat is offline   Reply With Quote

Old   August 31, 2013, 17:45
Default
  #19
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,it compiled well,but I don't know how to use it for my purpose yet!
Quote:
and how I have to use options for one field in two times of one case?how to use -time option?
__________________
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   August 31, 2013, 19:06
Default
  #20
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,511
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,

Quote:
Originally Posted by immortality View Post
thanks,it compiled well,but I don't know how to use it for my purpose yet!
... Oooohh... you wanted to compare times... you don't need foamCalcEx for that, OpenFOAM's foamCalc is enough.

Bernhard had already explained this in post #4:
Quote:
Originally Posted by Bernhard View Post
Well, easiest is to copy T en U from case 1 to case 2 (but with a different name), especially if you want to do this only once, it is a quick and dirty solution.
For example, in the tutorial "incompressible/icoFoam/cavity" case, I ran the following commands:
Code:
cp 0.1/p 0.2/p_0.1
foamCalc addSubtract p subtract -field p_0.1 -time 0.2
Which results in the field "p_subtract_p_0.1".

If you want to do this for all time instances, then... er... then some scripting is required... let's see if I can do this half-asleep :
Code:
fieldToCopy="p"
a=0
for b in $(foamListTimes); do

  cp $a/${fieldToCopy} $b/${fieldToCopy}_prev

  a=$b

done

foamCalc addSubtract ${fieldToCopy} subtract -field ${fieldToCopy}_prev
In this example, the field name specified in "fieldToCopy" will be copied between time snapshots with the new named "${fieldToCopy}_prev". For this specific case, the resulting difference field will be named "p_subtract_p_prev".

What you know... I did it half-asleep

Best regards,
Bruno
wyldckat 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
Overflow problem in steady simulation ReeKo CFX 11 October 8, 2008 17:57
Difference of temporally and spatially simulation? leaf Main CFD Forum 0 May 14, 2006 21:35
Unsteady vs Steady simulation - any difference? Sally Main CFD Forum 16 December 16, 2005 10:15
Fire simulation using FDS from NIST Jens Main CFD Forum 1 January 22, 2004 02:53
3-D Contaminant Dispersal Simulation Apple L S Chan Main CFD Forum 1 December 23, 1998 11:06


All times are GMT -4. The time now is 13:39.