CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Code creating unreadable characters in solutions

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By GerhardHolzinger

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 15, 2020, 21:30
Default Code creating unreadable characters in solutions
  #1
Cal
New Member
 
Calvin
Join Date: Nov 2019
Posts: 13
Rep Power: 6
Cal is on a distinguished road
Hi all,
I am new to openfoam and have been given code for my thesis to edit. It was written for openfoam v5 and I am running the code using openfoam v5. I am using the solver "sprayfoam" and after successful execution of the code, my solutions contain a lot of unreadable or unrecognized characters in the solution (see attached for examples)


Note: this issues is only present when there is a nonuniform list of scalars in the solution. The random characters shown in the picture attached continue for hundreds of lines before the code ends resulting in files from 700 kb - 2.2 mb.



Let me know if there are any other files you wish to see (controldict, 0 folder, etc), I haven't uploaded any because I have no idea what would be relevant to this issue


Thanks so much,


Cal
Attached Images
File Type: jpg Screenshot from 2020-01-16 12-57-25.jpg (169.3 KB, 30 views)
Cal is offline   Reply With Quote

Old   January 15, 2020, 21:36
Default
  #2
Senior Member
 
Join Date: Aug 2013
Posts: 407
Rep Power: 15
Antimony is on a distinguished road
Hi,

Is your writeFormat set to binary in the controlDict? If you want it to be human readable, then you should set the writeFormat to ascii.

Cheers,
Antimony
Antimony is offline   Reply With Quote

Old   January 15, 2020, 23:23
Default
  #3
Cal
New Member
 
Calvin
Join Date: Nov 2019
Posts: 13
Rep Power: 6
Cal is on a distinguished road
Hi Antimony,


Thanks for the reply, yes the format is set to ascii in the controldict do you know of any other possible reasons?


Thanks


Cal
Cal is offline   Reply With Quote

Old   January 16, 2020, 00:55
Default
  #4
Member
 
Andreas P.
Join Date: May 2017
Posts: 41
Rep Power: 8
AndreasPe is on a distinguished road
If you want to change the format of already existing files, you need to execute the "foamFormatConvert" utility.
AndreasPe is offline   Reply With Quote

Old   January 16, 2020, 01:53
Default
  #5
Cal
New Member
 
Calvin
Join Date: Nov 2019
Posts: 13
Rep Power: 6
Cal is on a distinguished road
Hi Andreas,


Thanks for the advice, I will try that on files I already have.

But I would like to create new solutions which aren't in this format, do you know hopw I would possibly do this?


or do you know what format my solutions are currently in?


Thanks
Cal is offline   Reply With Quote

Old   January 16, 2020, 02:06
Default
  #6
Member
 
Andreas P.
Join Date: May 2017
Posts: 41
Rep Power: 8
AndreasPe is on a distinguished road
If your controlDict says "ascii" as writeFormat, the solver should create only ascii format files. I tried the aachenBomb tutorial with "writeFormat ascii;" in the controldict and all files that were created are full ascii, so there should be no problem with sprayFoam there.

The header of the file you posted says "binary", so i would assume the writeFormat was set to binary (as it is originaly in the aachenBomb tutorial too).
AndreasPe is offline   Reply With Quote

Old   January 16, 2020, 14:05
Default
  #7
Senior Member
 
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 15
adhiraj is on a distinguished road
Just throwing this out there: is there any particular reason you want to avoid using binary files for writing the solution fields?

Binary files seem to speed up my runs (anecdotal, did not do a benchmark), and take less space on disk. Also, when writing in ASCII some information is lost depending on the write precision, which can impact restarts.

If you need to look at a particular field, you can always post-process the binary files. For anyone working with OpenFOAM I would recommend using binary files for output.
adhiraj is offline   Reply With Quote

Old   January 17, 2020, 03:38
Default
  #8
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 339
Rep Power: 28
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
A few points come to mind.

When to use ASCII write format in OpenFOAM?
  • Trouble-shooting: ASCII has the great benefit of being human-readable
  • Working with multiple tools: binary formats might get you into compatibility trouble, e.g. when importing the mesh into another tool to perform some operations on the mesh.
  • Working with multiple OpenFOAM variants/versions: foam-extend might/will write a slightly different binary format than the Foundation release or the ESI/OpenCFD release

When not to use ASCII format in OpenFOAM?
  • When you do actual computation runs
  • When you do mesh generation, and there is no need to use ASCII
Andrea1984 likes this.
GerhardHolzinger is offline   Reply With Quote

Old   January 23, 2020, 21:18
Default
  #9
Cal
New Member
 
Calvin
Join Date: Nov 2019
Posts: 13
Rep Power: 6
Cal is on a distinguished road
Hi all,


Thanks for all the help. I have been able to implement all your suggestions and have discovered that my issue isn't binary/ascii related after all.


Thanks so much for sharing your knowledge, it helped a lot!


Cal
Cal 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
Patankar CFD FORTRAN 90 Code FVM siddiquesil Main CFD Forum 19 October 25, 2022 05:21
Problems with Meshing: Collapsed Cells Emmanuel Resch Siemens 1 July 30, 2007 03:02
State of the art in CFD technology Juan Carlos GARCIA SALAS Main CFD Forum 39 November 1, 1999 14:34
public CFD Code development Heinz Wilkening Main CFD Forum 38 March 5, 1999 11:44
What kind of Cmmercial CFD code you feel well? Lans Main CFD Forum 13 October 27, 1998 10:20


All times are GMT -4. The time now is 09:11.