|
[Sponsors] | |||||
Writing themophysical propoerties during runtime by controldict |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
New Member
Join Date: Mar 2021
Posts: 8
Rep Power: 6 ![]() |
Hello there,
I'm using OF10 (rhoPimpleFoam). Previously I was modifying createFields.H file to get mu, cp, kappa etc. by using following example entry. Code:
volScalarField mu
(
IOobject
(
"mu",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo.mu()
);
Code:
writeviscosity
{
type coded;
libs ("libutilityFunctionObjects.so" "libOpenFOAM.so");
region main;
executeControl timeStep;
executeInterval 1;
writeControl writeTime;
log true;
code
#{
#include "fvCFD.H"
#include "volFields.H"
const volScalarField& mu = mesh().thermo.mu();
volScalarField mu
(
IOobject
(
"mu",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mu
);
#};
}
|
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 41 ![]() ![]() |
You are almost there. In your first example, you are creating the field, registering it and using AUTO_WRITE to make sure that it is being written.
With your updated code, the created field goes out ouf scope immediately so there is nothing hanging about for a later AUTO_WRITE to do at all. What you want is to write it yourself. Here's an example, https://develop.openfoam.com/Develop...em/controlDict |
|
|
|
|
|
![]() |
| Tags |
| function object, runtime processing, thermophysical properties, write data |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Other] Contribution a new utility: refine wall layer mesh based on yPlus field | lakeat | OpenFOAM Community Contributions | 58 | December 23, 2021 03:36 |
| SU2 7.0.7 Built on CentOS 7, parallel computation pyscript mpi exit error? | EternalSeekerX | SU2 | 3 | October 9, 2020 19:28 |
| decomposePar problem: Cell 0contains face labels out of range | vaina74 | OpenFOAM Pre-Processing | 37 | July 20, 2020 06:38 |
| [mesh manipulation] Importing Multiple Meshes | thomasnwalshiii | OpenFOAM Meshing & Mesh Conversion | 18 | December 19, 2015 19:57 |
| [snappyHexMesh] crash sHM | H25E | OpenFOAM Meshing & Mesh Conversion | 11 | November 10, 2014 12:27 |