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

OpenFOAM 2: foamCalc probeLocations initial density question

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 7, 2018, 15:12
Question OpenFOAM 2: foamCalc probeLocations initial density question
  #1
New Member
 
Graham
Join Date: Nov 2017
Posts: 5
Rep Power: 9
EnigmaFluids is on a distinguished road
Hello,

I am using OpenFOAM 2.3.0 probeLocations function to gather property data for plotting over time. Using this produces a 0/ directory and a 0.001/ directory (the first saved time step). Inside the 0/ directory we have property files like temperature T, pressure p, etc. Inside the 0.001/ directory we have a single rho file. This is because rho is not calculated at time 0. However I am building a script to compile all the sample data for plotting in excel and it would be convenient if I could calculate the rho property for time 0 so that all the property files end up in the 0/ directory. Does anyone know of a convenient way to do this. Is there a subfunction in foamCalc that I've missed?

Thank you for your time.

More background: The reason I am using such an old version of OpenFOAM is that my research lab has created a few custom solvers that have not been updated to work with the new library structure of OpenFOAM 4+
EnigmaFluids is offline   Reply With Quote

Old   August 9, 2018, 06:58
Default
  #2
ano
Member
 
ano
Join Date: Jan 2017
Location: Delft
Posts: 58
Rep Power: 10
ano is on a distinguished road
Hi EnigmaFluids,


I didn't try myself, but perhaps you get it, if you modify your solver in a manner that it outputs rho from the beginning. After sourcing your Openfoam version, you would have to type in your terminal:

Code:
sol
which brings you to the source code for the solvers. Go to the directory which is called like your solver and open 'createFields.H'


Below the definition of rho, which will look similar to:

Code:
    volScalarField rho
    (
        IOobject
        (
            "rho",
            runTime.timeName(),
            mesh
        ),
        thermo.rho()
    );
add a line
Code:
rho.write();
Afterwards close the file and recompile by typing
Code:
wmake
Running this modified solver should give you the rho at the initial time step. In case you don't want to rerun the whole case, you can change your controlDict to rerun only from time 0 to 0.
ano is offline   Reply With Quote

Old   August 23, 2018, 17:45
Default
  #3
New Member
 
Graham
Join Date: Nov 2017
Posts: 5
Rep Power: 9
EnigmaFluids is on a distinguished road
Ano,

This was very helpful. Thanks!
EnigmaFluids is offline   Reply With Quote

Reply

Tags
foamcalc, openfoam2.3.x, probelocations


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
Suppress twoPhaseEulerFoam energy AlmostSurelyRob OpenFOAM Running, Solving & CFD 33 September 25, 2018 18:45
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 12:08
simpleFoam error - "Floating point exception" mbcx4jc2 OpenFOAM Running, Solving & CFD 12 August 4, 2015 03:20
Compressor Simulation using rhoPimpleDyMFoam Jetfire OpenFOAM Running, Solving & CFD 107 December 9, 2014 14:38
pisoFoam with k-epsilon turb blows up - Some questions Heroic OpenFOAM Running, Solving & CFD 26 December 17, 2012 04:34


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