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

Create filds in codedFunctionObjects

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 5, 2022, 13:30
Default Create filds in codedFunctionObjects
  #1
New Member
 
Join Date: Sep 2022
Posts: 18
Rep Power: 3
newGuyAtCFD is on a distinguished road
Hello,


I am using OpenFOAM v2112 and would like to know if there is a proper way to create fields in coded functionObjects:

Should it be:

Code:
volScalarField aField                     
(                                
    IOobject                       
    (                              
        "aField",                     
         mesh().time().timeName(),    
         mesh(),                      
         IOobject::NO_READ,           
        IOobject::AUTO_WRITE
    ),                             
     mesh(),                         
    dimensionedScalar (dimless, scalar(0) ) 
);
Or


Code:
volScalarField aField                     
(                                
    IOobject                       
    (                              
        "aField",                     
         mesh().time().timeName(),    
         mesh(),                      
         IOobject::NO_READ,           
         IOobject::NO_WRITE,
        false
    ),                             
     mesh(),                         
    dimensionedScalar (dimless, scalar(0) ) 
);
Will the first form create a memory leak? Does it make a difference?

Last edited by newGuyAtCFD; September 5, 2022 at 15:10.
newGuyAtCFD 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
create the file *.foam phongstar OpenFOAM 12 October 14, 2018 18:06
[GAMBIT] How to plot S pipe mariam.sara ANSYS Meshing & Geometry 36 November 7, 2013 15:22
[ANSYS Meshing] is it possible to create virtual edges on the blades er_ijaz ANSYS Meshing & Geometry 0 November 3, 2013 05:15
[DesignModeler] Design Modeller create surface papis ANSYS Meshing & Geometry 0 October 31, 2013 13:52
About create interface! xinzhiyu2008 STAR-CCM+ 2 August 6, 2010 20:47


All times are GMT -4. The time now is 20:45.