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 Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By GerhardHolzinger

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: 5
Rep Power: 2
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, 19 views)
Cal is offline   Reply With Quote

Old   January 15, 2020, 22:36
Default
  #2
Senior Member
 
Join Date: Aug 2013
Posts: 384
Rep Power: 10
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: 5
Rep Power: 2
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
New Member
 
Andreas P.
Join Date: May 2017
Posts: 24
Rep Power: 4
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: 5
Rep Power: 2
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
New Member
 
Andreas P.
Join Date: May 2017
Posts: 24
Rep Power: 4
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: Maryland, United States
Posts: 141
Rep Power: 11
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: 267
Rep Power: 22
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

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
Patankar CFD FORTRAN 90 Code FVM siddiquesil Main CFD Forum 18 January 7, 2020 21:25
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 00:22.