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

Access to a field of a lagrangian post-processing cloudFunction

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 13, 2019, 06:46
Default Access to a field of a lagrangian post-processing cloudFunction
  #1
Ake
New Member
 
Kevin
Join Date: May 2018
Posts: 6
Rep Power: 8
Ake is on a distinguished road
Hi,

i am creating new fields in createFields.H dict which are the copy of a certain given field. For example the "wallShearStress" and a "new field".
Code:
volVectorField wallShearStress
 (
    IOobject
    (
       "wallShearStress",
        runTime.timeName(),
        mesh,
        IOobject::READ_IF_PRESENT,
        IOobject::AUTO_WRITE
    ),
    mesh,
 dimensionedVector("wallShearStress",dimensionSet( 0, 2, -2, 0, 0, 0, 0),Zero)
 );
volVectorField newField
(
    IOobject
    (
       "newField",
        runTime.timeName(),
        mesh,
        IOobject::READ_IF_PRESENT,
        IOobject::AUTO_WRITE
    ),
    mesh,
 dimensionedVector("newField",dimensionSet( 0, 2, -2, 0, 0, 0, 0),Zero)
);
In the controlDict i added the wallShearStress function, which calculates the shear stress in every time step.
Code:
    wallShearStress
    {
        type            wallShearStress;
        libs            ("libfieldFunctionObjects.so");
        executeControl  timeStep;
        writeControl    writeTime;
    }
In my solver.C file i added
Code:
newField=wallShearStress;
so the field "newField" is exactly a copy of the field "wallShearStress" in every time step. This is just an example, i actually do this to have/create fields which can be easily modified by me. This might be a "beginners solution" because i am not very good in OpenFoam programming but it works properly for me.


I tried to do exactly the same with a field which is created by a lagrangian post-processing cloud function "OwnPatchCollisionDensity" ("OwnPatchCollisionDensity" function is just a modified version of the standard "patchCollisionDensity" function). This function is added in the kinematicCloudProperties and it writes a boundary field which is called "collision" in my stored time folders.
Code:
cloudFunctions
{

    myCollisionFunction
    {
        type            OwnPatchCollisionDensity;
    }
  }
The function generally works properly. But, if i do the same procedure as described above (rename the field "wallShearStress" to "collision"), both fields, "collision" and "newField", remain empty. So the cloudFunction do not overwrite my created field as it does in the wallShearStress case.





1. Somebody has an idea why the fields "collision" and "newField" remain empty ? Maybe it is because the field "collision" is only a boundaryField? But isnt wallShearStress also only a boundaryField?


2. Maybe somebody has an other idea how to get access to the field of a lagrangian post-processing cloudFunction?




Thanks in advance!
Ake 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
Post processing journal - like .cst in CFD Post Jiricbeng FLUENT 0 April 24, 2019 09:08
post processing density rho with foamCalc openfoam4.0 extend Flexflix OpenFOAM Post-Processing 0 May 18, 2018 05:13
Post processing heat flow at inlet and outlet gerrit91 OpenFOAM Programming & Development 0 January 6, 2018 08:40
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51


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