CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   porousZone.C writeDict() (http://www.cfd-online.com/Forums/openfoam-programming-development/94422-porouszone-c-writedict.html)

Hisham November 15, 2011 09:21

porousZone.C writeDict()
 
Dear Foamers,

Can you help me understand which purpose this function serves?

http://foam.sourceforge.net/docs/cpp...ce.html#l00394

Code:


00394 void Foam::porousZone::writeDict(Ostream& os, bool subDict) const
00395 {
00396    if (subDict)
00397    {
00398        os  << indent << token::BEGIN_BLOCK << incrIndent << nl;
00399        os.writeKeyword("name")
00400            << zoneName() << token::END_STATEMENT << nl;
00401    }
00402    else
00403    {
00404        os  << indent << zoneName() << nl
00405            << indent << token::BEGIN_BLOCK << incrIndent << nl;
00406    }
00407
00408    if (dict_.found("note"))
00409    {
00410        os.writeKeyword("note")
00411            << string(dict_.lookup("note")) << token::END_STATEMENT << nl;
00412    }
00413
00414    coordSys_.writeDict(os, true);
00415
00416    if (dict_.found("porosity"))
00417    {
00418        os.writeKeyword("porosity")
00419            << porosity() << token::END_STATEMENT << nl;
00420    }
00421
00422    if (dict_.found("intensity"))
00423    {
00424        os.writeKeyword("intensity")
00425            << intensity() << token::END_STATEMENT << nl;
00426    }
00427
00428    if (dict_.found("mixingLength"))
00429    {
00430        os.writeKeyword("mixingLength")
00431            << mixingLength() << token::END_STATEMENT << nl;
00432    }
00433
00434    // powerLaw coefficients
00435    if (const dictionary* dictPtr = dict_.subDictPtr("powerLaw"))
00436    {
00437        os  << indent << "powerLaw";
00438        dictPtr->write(os);
00439    }
00440
00441    // Darcy-Forchheimer coefficients
00442    if (const dictionary* dictPtr = dict_.subDictPtr("Darcy"))
00443    {
00444        os  << indent << "Darcy";
00445        dictPtr->write(os);
00446    }
00447
00448    // thermalModel
00449    if (const dictionary* dictPtr = dict_.subDictPtr("thermalModel"))
00450    {
00451        os  << indent << "thermalModel";
00452        dictPtr->write(os);
00453    }
00454
00455    os  << decrIndent << indent << token::END_BLOCK << endl;
00456 }
00457

Best regards,
Hisham

olesen November 16, 2011 05:33

Quote:

Originally Posted by Hisham (Post 332193)
Dear Foamers,

Can you help me understand which purpose this function serves?

http://foam.sourceforge.net/docs/cpp...ce.html#l00394

...

Quite simply actually. You can use it to output the dictionary settings associated with the porous zone.

Hisham November 16, 2011 05:42

Just that ...... Is it not then needed by any other class?????

I mean it is not called by OF for any reason than if the developer (i.e. I) calls it ??

olesen November 16, 2011 05:46

Quote:

Originally Posted by Hisham (Post 332285)
Just that ...... Is it not then needed by any other class?????

I mean it is not called by OF for any reason than if the developer (i.e. I) calls it ??

AFAIK it is just part of the IO for the class. The only place it might be used indirectly is if you need a SHA1 of the input dictionary.

Hisham November 16, 2011 05:59

Thanks a lot Olesen. The issue is that I'm developing a class based on the porousZone class and was wondering if I should invest time modifying this function .....

I guess I will save my time for now and leave it as is, until I have more concrete info or a related error!

Best regards,
Hisham


All times are GMT -4. The time now is 06:42.