How to correctly show the result of #codeStream# internalField?
Hi, everyone
I just used codeStream to generate some initial condtion and codedFixedValue to generate some boundary condtion. The codedFixedValue BC can be correctly executed and loaded using paraFoam (I am using OF1612+ in docker), however, the codeStream initial condition can be correctly interpreted and executed but cannot be loaded in paraFoam. I was running the forwardStep with following "0/U" file Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
Created temporary 'forwardStepMod3.OpenFOAM' Code:
Created temporary 'forwardStepMod3.OpenFOAM' |
Quick answer: You have this:
Code:
codeOptions Code:
//! libs: |
Dear Bruno
Thank you so much for you reply! |
Hi Bruno,
I just tried to use "paraview" rather than "paraFoam" to post-process the result after time "0". However, the "U" field cannot be read and here is the errors: Code:
ERROR: In /home/buzz2/pawan/OpenFOAM/ThirdParty-1606_plus/ParaView-5.0.1/VTK/IO/Geometry/vtkOpenFOAMReader.cxx, line 6497 Code:
internalField nonuniform List<vector> |
Hi,
AFAIK, there isn't a very straightforward way to do this. What I do is to open up the result file and modify the type from 'coded...' to 'fixedValue'. OF seems to write the values in any case (usually in the line/lines right below type) and so making this change allows Paraview to understand and display the velocity. Hope this helps. Cheers, Antimony |
Quick answer: If the file extension ".OpenFOAM" is not used and instead the built-in reader with ".foam" is used instead, then it will not work. You could try with ParaView 5.3, but I haven't tested it yet.
The only other solution is to use foamToVTK and then open the VTK files in ParaView. |
Dear Bruno
Thanks for your suggestion. I will try foamToVTK. |
Implementing a new IOobject
Hi,
I am using OpenFOAM 4.1 for melting and solidification problem. I am following this thread https://www.cfd-online.com/Forums/op...angoni-bc.html for writing marangoni BC. The boundary condition uses an IOobject of volVectorField gradT. The thread suggest putting IOobject in solver. I want to know the possibility of calculating gradT from controlDict using functionObjects or codeStream. I have written the controlDict in this way Code:
/*--------------------------------*- C++ -*----------------------------------*\ -- Tarang |
I think you can use post-processor to calculate grad(T)
|
Will I be able to use "post process"ed grad(T) as volVectorField in boundaryConditionFvPatchField?
|
sorry, I misunderstood your purpose.
As far as I know. #codeStream is just used to generate some "TEXT" in the controlDict or other text-based configuration file for OpenFOAM. If you want to use some volVectorField grad(T) in your BC. you must modify your solver. |
Thanks chengdi. I have modified my solver to calculate gradT. One thing about the #codestream in controlDict I want to ask is that where in the execution flow process the code is executed?
|
Quote:
You may understand it like this: When the foam app read the controlDict, what your app actually read is the text generated by your #codeStream at the start of the dict-entry-reading. |
Hi
I use codeStream BC for U I tried to access time as you posted in https://www.cfd-online.com/Forums/op...tml#post647952 However I got error "error: invalid use of ‘this’ in non-member function" in the line scalar t = this->db().time().value(); My U file is Code:
dimensions [0 1 -1 0 0 0 0]; |
Hi Foamers,
I got the same error as you: Quote:
Thanks! |
Hi
I did not solve this. I used codedFixedValue instead of fixedValue. |
:confused: I'm not really into the difference between codedFixedValue and fixedValue. But i am initializing a IC so I use: internalField #codeStream
Quote:
|
you can find basic info here
https://www.openfoam.com/documentati...xed-value.html or search on the forum |
Quote:
It seems that by "scalar t = this->db().time().value(); " we can access time just for codedFixedvalue Does anybody know how can I access time (of simulation) in "codeStream"? |
change
Code:
fixedValue Code:
codedFixedValue |
All times are GMT -4. The time now is 23:04. |