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 Tree2Likes
  • 1 Post By GerhardHolzinger
  • 1 Post By AdrianaPinto2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 15, 2020, 22:30
Default Code creating unreadable characters in solutions
  #1
Cal
New Member
 
Calvin
Join Date: Nov 2019
Posts: 13
Rep Power: 7
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, 40 views)
Cal is offline   Reply With Quote

Old   January 15, 2020, 22:36
Default
  #2
Senior Member
 
Join Date: Aug 2013
Posts: 407
Rep Power: 16
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 16, 2020, 00:23
Default
  #3
Cal
New Member
 
Calvin
Join Date: Nov 2019
Posts: 13
Rep Power: 7
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, 01:55
Default
  #4
Member
 
Andreas P.
Join Date: May 2017
Posts: 41
Rep Power: 9
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, 02:53
Default
  #5
Cal
New Member
 
Calvin
Join Date: Nov 2019
Posts: 13
Rep Power: 7
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, 03:06
Default
  #6
Member
 
Andreas P.
Join Date: May 2017
Posts: 41
Rep Power: 9
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, 15:05
Default
  #7
Senior Member
 
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 16
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, 04:38
Default
  #8
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
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, 22:18
Default
  #9
Cal
New Member
 
Calvin
Join Date: Nov 2019
Posts: 13
Rep Power: 7
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

Old   June 3, 2024, 08:11
Default
  #10
New Member
 
Adriana Pinto
Join Date: Nov 2023
Posts: 2
Rep Power: 0
AdrianaPinto2 is on a distinguished road
Quote:
Originally Posted by Cal View Post
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
Hello Cal, I know this is kinda of an old thread, but I have a similar problem and would like to know how you resolved yours.

Thank you for your attention.
unilord likes this.
AdrianaPinto2 is offline   Reply With Quote

Old   June 3, 2024, 10:24
Default
  #11
Member
 
Pedro Gouveia
Join Date: Oct 2022
Location: Portugal
Posts: 64
Rep Power: 4
unilord is on a distinguished road
Quote:
Originally Posted by AdrianaPinto2 View Post
Hello Cal, I know this is kinda of an old thread, but I have a similar problem and would like to know how you resolved yours.

Thank you for your attention.

Hello Adriana and Cal. I am having a similar problem. For context, my university lab bought a desktop with a intel 9 13 serioes CPU, and openfoam, when using the decomposePar command, inserts unreadable characters in random files. For instance, sometimes it creates unreadable characters in the processorX/constant/ files (can be in faces, points, etc), sometimes it creates in the processorX/timestep/p,U,k,omega,nut files, and I can not reconstructPar. It is sad because we get the most out of the CPU when using all the cores, and not running in a single core.


If someone has any idea, please let me know. It literally writes the code in ascii but in some lines it inserts characters such as &, and unreadable characters as you can see in the attached image.
Attached Images
File Type: jpeg case.jpeg (99.5 KB, 7 views)
unilord 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 06:21
Problems with Meshing: Collapsed Cells Emmanuel Resch Siemens 1 July 30, 2007 04:02
State of the art in CFD technology Juan Carlos GARCIA SALAS Main CFD Forum 39 November 1, 1999 15:34
public CFD Code development Heinz Wilkening Main CFD Forum 38 March 5, 1999 12:44
What kind of Cmmercial CFD code you feel well? Lans Main CFD Forum 13 October 27, 1998 11:20


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