|
[Sponsors] |
Why is my new variable constant in all time steps? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 5, 2022, 09:13 |
Why is my new variable constant in all time steps?
|
#1 |
New Member
Join Date: Sep 2020
Location: Germany
Posts: 17
Rep Power: 5 |
I am working in OpenFoamV8 with buoyantPimpleFoam. I have created a new variable "Test" in the solver code. Test should be the sum of the current temperature and a user defined constant value "Tc". My solver compiles and I get results, but the variable Test does not change over time!
Only the first time step "Test" is calculated and stays constant for all time steps. Although T changes over time! How can that be? The error must be in the following code: I have added these lines to Ueqn.H: Code:
const volScalarField& T = mesh.lookupObject<volScalarField>("T"); dimensionedScalar Tc(magneticProperties.lookup("Tc")); volScalarField Test = T + Tc; Code:
Info<< "Reading magnetic properties\n" << endl; IOdictionary magneticProperties ( IOobject ( "magneticProperties", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); dimensionedScalar Tc(magneticProperties.lookup("Tc")); Info<< "Reading field Test\n" <<endl; volScalarField Test ( IOobject ( "Test", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[General] Extracting ParaView Data into Python Arrays | Jeffzda | ParaView | 30 | November 6, 2023 21:00 |
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field | lakeat | OpenFOAM Community Contributions | 58 | December 23, 2021 02:36 |
pimpleDyMFoam computation randomly stops | babapeti | OpenFOAM Running, Solving & CFD | 5 | January 24, 2018 05:28 |
Stuck in a Rut- interDyMFoam! | xoitx | OpenFOAM Running, Solving & CFD | 14 | March 25, 2016 07:09 |
Floating point exception error | lpz_michele | OpenFOAM Running, Solving & CFD | 53 | October 19, 2015 02:50 |