Write out turbulence model functions
I am trying to modify turbulence models and would like to write out the value of some functions. For example, in kOmegaSST.C there is a private member function called F1. I would like to write out the value of this function each time I write out the other dependent variables.
I have tried the following syntax:
While technically this works, the file name which is created is not "F1", but the function representation of F1 (e.g. tanh(pow4(min(min(max((((1|betaStar)*sqrt....)
Is there any way to force OpenFOAM to name this file something meaningful, like "F1"?
what you want to modify?
Thanks for the help. I thought I had tried this before, and it did not work. I copied your syntax and everything works fine. I must have had a typo.
While the IOobject works, I am still wonding if there is a possibility of using the ".write()" function to accomplish this. The problem with the IOobject approach is that it requires a user to add an initial condition for "F1". This is not hard, but if an inexperienced user does not know that they need this initial condition, it can lead to lots of questions for me. Does anyone know the syntax to accomplish this with ".write()" ?
No it does work
i use this to output F1,and you could find out in the post before.
for initial condition i think it is not important for steady calculation.it is just a guess and after iteration it will get the correct values.
You could also change the
and use a different constructor for the F1
NO_WRITE does not work
I know that I have tried this before... and I just did to reconfirm. If I make this change to my current code, it will compile fine. However, at run time I get an error like...
NO_READ specified for read-constructor of object F1 of class IOobject#0 Foam::error::printStack(Foam::Ostream&) in "/home/edge/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::error::abort() in "/home/edge/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Foam::regIOobject::readStream() in "/home/edge/OpenFOAM/OpenFOAM-1.5/lib/linuxGccDPOpt/libOpenFOAM.so"
You mentioned using a different constructor for F1. Could you elaborate on this a little? I appologize; I am a long time Fortran 90/95 user and am still working on learning C++.
Well, then welcome to the world of C++:)
What I mean by using a different constructor is that you can choose to set it to the field of another volScalarField, e.g.
as initialization, and then you can set the values on run-time! Note that the one you have used initializes based on the mesh, whereas my initializes based on another volScalarField. You will be able to find examples of this use in e.g. /interFoam/createFields.H.
You can find the documentation here:
Hope it did help,
Thank you for the explanation. It is very helpful.
|All times are GMT -4. The time now is 02:01.|