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

Creating an output file

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 29, 2018, 07:17
Exclamation Creating an output file
  #1
New Member
 
Davide
Join Date: Jun 2018
Posts: 10
Rep Power: 8
Lighto is on a distinguished road
Hello everyone.

I'm very new to CFD enviroment and OpenFOAM software. I've managed to implement a lagrangian particle tracker inside pimpleFoam (I don't know if I can post here the reference pdf). Now I need to create an output file just like the one for velocity, pressure etc. but for the shear stress on particles, i.e. I need to output first order derivatives of u1,u2,u3 in x1,x2,x3, and then calculate the scalar stress:

\sigma = \frac{1}{\sqrt{3}}\sqrt{\tau_{11}^2+\tau_{22}^2+\tau_{33}^2-\tau_{11}\tau_{22}-\tau_{22}\tau_{33}-\tau_{33}\tau_{11}+3(\tau_{12}^2+\tau_{23}^2+\tau_{31}^2)}

where \tau_{ij} = \mu (\frac{\partial{u_i}}{\partial{x_j}}+\frac{\partial{u_j}}{\partial{x_i}})

This last part I think is easier once I understood how to output the spatial derivatives of the particles' velocities.
How can I implement this in OpenFOAM and in which file of the solver?

Thanks for your help.

Davide

Last edited by Lighto; June 30, 2018 at 12:12. Reason: mistake in tau expression
Lighto is offline   Reply With Quote

Old   June 30, 2018, 12:07
Default
  #2
New Member
 
Davide
Join Date: Jun 2018
Posts: 10
Rep Power: 8
Lighto is on a distinguished road
I've read so many topics in these 24 hours but I didn't managed to solve my problem

However I have done a small progress, that I post here.
In the createFields.H file in the solver folder I've added the following lines to output the gradient of the vector field U (named DUDX):

Code:
volTensorField DUDX
(
    IOobject
    (
        "DUDX",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::AUTO_WRITE
    ),
    mesh,
    //assign dim of tensor and inizialize it to zero
    dimensionedTensor("DUDX", dimVelocity/dimLength, tensor::zero)
);
and update it at every time step in the solver.C file, after the velocity corrector loop:

Code:
while (runTime.run())
    {
        ...
        // --- Pressure-velocity PIMPLE corrector loop
        ...
        DUDX = fvc::grad(U);
        ...
    }
(Note: i'm using a pimple solver with lagrangian particle tracking.)

This should output the gradient of the velocity as a tensor of 9 components du1/dx1, du2/dx1, etc. in the whole domain, but I want it only for the particles (so gradient of U of the particles, not U of the fluid).
Lighto is offline   Reply With Quote

Reply

Tags
derivatives, openfoam 4.0 extend, output, output file, stress


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
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 ordinary OpenFOAM Installation 19 September 3, 2019 19:13
[OpenFOAM.org] Patches to compile OpenFOAM 2.2 on Mac OS X gschaider OpenFOAM Installation 136 October 10, 2017 18:25
[swak4Foam] groovyBC in openFOAM-2.0 for parabolic velocity bc ofslcm OpenFOAM Community Contributions 25 March 6, 2017 11:03
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 17:02
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 18:51


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