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

Does sampleDict have limitation in number of fields?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By alexeym

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 18, 2018, 12:45
Default Does sampleDict have limitation in number of fields?
  #1
New Member
 
Reza Nouri
Join Date: Oct 2012
Location: Tennessee
Posts: 26
Rep Power: 13
reza2031 is on a distinguished road
Send a message via Skype™ to reza2031
Hi,


I have 32 fields which I would like to monitor using sampleDict.

The issue is that I get error when I have 32 fields added in sampleDict but when I remove any of them (it does not matter which one) it works fine.

To me it is really strange. Is there any limitation on the number of fields which can be added to sampleDict?



sampleDict:
Code:
sets
(
    nearTop
    {
        type    uniform;
        axis    xyz;
        start   ( 10 20 0.5 );
        end     ( 20 20 0.5 );
        nPoints 5;
    }

    nearBottom
    {
        type    uniform;
        axis    xyz;
        start   ( 10 90 0.5 );
        end     ( 20 90 0.5 );
        nPoints 5;
    }
);

fields          (C_S_su C_S_aa C_S_fa C_S_va C_S_bu C_S_pro C_S_ac C_S_h2 C_S_ch4 C_S_ic C_S_in C_S_i C_X_c C_X_ch C_X_pr C_X_li C_X_su C_X_aa C_X_fa C_X_c4 C_X_pro C_X_ac C_X_h2 C_X_i C_S_cat C_S_an C_S_va_ion C_S_bu_ion C_S_pro_ion C_S_ac_ion C_S_hco3_ion C_S_nh3);
Error:
Code:
Time = 10

Reading fields:
    volScalarFields: C_S_i C_S_aa C_S_hco3_ion C_S_cat C_S_pro C_S_fa C_S_ac_ion C_S_nh3 C_S_pro_ion C_X_su C_X_h2 C_S_an C_X_c C_S_bu_ion C_X_aa C_X_i C_S_ic C_S_bu C_X_c4 C_X_pro C_S_va C_X_ch C_S_in C_S_su C_S_ac C_X_li C_S_ch4 C_X_pr C_X_ac C_S_h2 C_S_va_ion C_X_fa

Executing functionObjects
--> FOAM Warning : 
    From function void Foam::sampledSets::writeSampleFile(const Foam::coordSet&, const Foam::PtrList<Foam::sampledSets::volFieldSampler<T> >&, Foam::label, const Foam::fileName&, const Foam::writer<Type>&) [with Type = double; Foam::label = int]
    in file sampledSet/sampledSets/sampledSetsTemplates.C at line 161
    File "/home/rigel/openFOAM/runJune/New/Cases/CASE/postProcessing/sampleDict/10/nearTop_C_S_su_C_S_aa_C_S_fa_C_S_va_C_S_bu_C_S_pro_C_S_ac_C_S_h2_C_S_ch4_C_S_ic_C_S_in_C_S_i_C_X_c_C_X_ch_C_X_pr_C_X_li_C_X_su_C_X_aa_C_X_fa_C_X_c4_C_X_pro_C_X_ac_C_X_h2_C_X_i_C_S_cat_C_S_an_C_S_va_ion_C_S_bu_ion_C_S_pro_ion_C_S_ac_ion_C_S_hco3_ion_C_S_nh3.xy" could not be opened. No data will be written
--> FOAM Warning : 
    From function void Foam::sampledSets::writeSampleFile(const Foam::coordSet&, const Foam::PtrList<Foam::sampledSets::volFieldSampler<T> >&, Foam::label, const Foam::fileName&, const Foam::writer<Type>&) [with Type = double; Foam::label = int]
    in file sampledSet/sampledSets/sampledSetsTemplates.C at line 161
    File "/home/rigel/openFOAM/runJune/New/Cases/CASE/postProcessing/sampleDict/10/nearBottom_C_S_su_C_S_aa_C_S_fa_C_S_va_C_S_bu_C_S_pro_C_S_ac_C_S_h2_C_S_ch4_C_S_ic_C_S_in_C_S_i_C_X_c_C_X_ch_C_X_pr_C_X_li_C_X_su_C_X_aa_C_X_fa_C_X_c4_C_X_pro_C_X_ac_C_X_h2_C_X_i_C_S_cat_C_S_an_C_S_va_ion_C_S_bu_ion_C_S_pro_ion_C_S_ac_ion_C_S_hco3_ion_C_S_nh3.xy" could not be opened. No data will be written

End
reza2031 is offline   Reply With Quote

Old   June 19, 2018, 08:46
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

I think, it is limitation of a file system (file name length, ex. https://serverfault.com/questions/95...imits-on-linux). sample utility object reads all field names normally, but when it tries to create output file, it fails.
reza2031 likes this.
alexeym is offline   Reply With Quote

Old   June 20, 2018, 05:20
Default
  #3
New Member
 
Reza Nouri
Join Date: Oct 2012
Location: Tennessee
Posts: 26
Rep Power: 13
reza2031 is on a distinguished road
Send a message via Skype™ to reza2031
Quote:
Originally Posted by alexeym View Post
Hi,

I think, it is limitation of a file system (file name length, ex. https://serverfault.com/questions/95...imits-on-linux). sample utility object reads all field names normally, but when it tries to create output file, it fails.
Hi Alexey,
Thank you for your reply. You are right. I reduced the fields' names and now it works fine.


Bests,
Reza
reza2031 is offline   Reply With Quote

Old   April 22, 2020, 13:24
Default
  #4
Member
 
Join Date: Dec 2018
Location: Darmstadt, Germany
Posts: 87
Rep Power: 7
raumpolizei is on a distinguished road
Hey there,

I don't know if this is still relevant but maybe someone will someday face the same problem that I did. I wanted to output a very high number (~1000) of fields in sets to postprocess them in a second step. Due to the maximum file name limit and the naming convention of OF output files when sets are created, it is impossible to write everything in one file. So I wrote a small script that basically ensures that all fields are divided in various (sub) sets functionObjects so that the maximum file name length is kept smaller than 255. The script must of course be modified to consider your personal field names and set data. It writes an outputfile "manyFieldsFO" (manyFields-FunctionObject) in the system folder of your case. This file can then be included in the controlDict file in the functions subdict.
Code:
functions
{
    #include "${FOAM_CASE}/system/manyFieldsFO"
}
The names are rather generic and I hope it is not too difficult to understand. You can contact me if you have problems using it. Or maybe it can inspire you, if you want to output hundreds or thousands of fields to output files like I wanted to. Good luck!
RP

PS 1: it's a python script >> python3 createManyFieldSets.py
PS 2: Somehow, It is not possible to attach python scripts. I had to zip it.
PS 3: If any OF-dev reads this - I know it is a niche but it would be nice to be able to specify an alternative output file name to bypass this problem.
Attached Files
File Type: zip createManyFieldSets.zip (1.2 KB, 7 views)
raumpolizei is offline   Reply With Quote

Reply

Tags
sampledict


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
decomposePar no field transfert Jeanp OpenFOAM Pre-Processing 3 June 18, 2022 12:01
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 18:57
decomposePar -allRegions stru OpenFOAM Pre-Processing 2 August 25, 2015 03:58
foam-extend_3.1 decompose and pyfoam warning shipman OpenFOAM 3 July 24, 2014 08:14
[blockMesh] --> foam fatal error: lillo763 OpenFOAM Meshing & Mesh Conversion 0 March 5, 2014 10:27


All times are GMT -4. The time now is 08:34.