|
[Sponsors] |
how to write quantities from interfaceProperties.C ? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 8, 2014, 02:43 |
how to write quantities from interfaceProperties.C ?
|
#1 |
New Member
Join Date: Jul 2014
Posts: 12
Rep Power: 12 |
Dear all:
Now I am using interFoam to simulate two-phase flow. And I want to write out private data in interfaceProperties.C like curvature. Because in createFields.H of interFoam there is an object ''interface'' of class ''interfaceProperties''. So I just add this in createFields.H : Code:
volScalarField K ( IOobject ( "K", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), interface.K() ); So how to solve this problem ? Any hint is appreciated. |
|
October 8, 2014, 03:38 |
|
#2 |
Senior Member
|
Hi,
you should update your K after interface.correct() call to copy newly calculated values to your variable. You can do it with simple K = interface.K(). Also you can try to get K from object registry and modify its wirteOpts and path, but it'll be more complicated. |
|
October 8, 2014, 05:40 |
|
#3 |
New Member
Join Date: Jul 2014
Posts: 12
Rep Power: 12 |
Hi, Alexey:
Thank you for your reply. It works! Yes, this is simple to implement than writing another .C like writeCellCenters.C. |
|
August 24, 2015, 16:10 |
Ploting K
|
#4 |
Member
Mahmoud Aboukhedr
Join Date: Feb 2014
Location: London
Posts: 40
Rep Power: 12 |
Dear All,
I tried to follow what you said to plot K, but it failed to compile. What I did is ,, 1) Added this piece of code to the creatPatch.h file in interfoam Info<< "Reading field K\n" << endl; volScalarField K ( IOobject ( "K", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), K = interface.K() ); 2) Then compiled I got this error each time .. createFields.H: In function ‘int main(int, char**)’: createFields.H:40:12: error: ‘interface’ was not declared in this scope In file included from myinterFoam.C:61:0: /home/ofoam/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude/readTimeControls.H:38:8: warning: unused variable ‘maxDeltaT’ [-Wunused-variable] make: *** [Make/linux64GccDPOpt/myinterFoam.o] Error 1 I tried to change the code to Info<< "Reading field K\n" << endl; volScalarField K ( IOobject ( "K", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); it complie but nothing happens in the K file after the run Any help will do .. Thanks mahmoud |
|
Tags |
curvature, interfoam, ioobject |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mesh file for flow over a circular cylinder | Ardalan | Main CFD Forum | 7 | December 15, 2020 14:06 |
[Helyx OS] Helyx-OS (GUI for SnappyHexMesh | elvis | OpenFOAM Community Contributions | 210 | January 30, 2017 19:57 |
Reading Additional Data Quantities from Fluent into Tecplot | fremder | Tecplot | 9 | December 16, 2016 16:35 |
[snappyHexMesh] Debug option in snappy / Write volScalarField with cellLevel for postprocessing | Ruli | OpenFOAM Meshing & Mesh Conversion | 1 | March 30, 2014 09:57 |
Phase locked average in run time | panara | OpenFOAM | 2 | February 20, 2008 15:37 |