|
[Sponsors] |
April 9, 2015, 07:53 |
Values of a volScalarField not updated
|
#1 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
Hi all,
I will try my best to describe my problem, but it is very puzzling. I have a runTime-selectable class that contains a volScalarField, which is constructed in the following manner: Code:
weights_ ( IOobject ( "weights", mesh.time().timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedScalar("null", dimless, 0.0), "zeroGradient" ) Code:
void simpleSpatialCorrections::update() { weights_.internalField() += 1.0; weights_.correctBoundaryConditions(); // if (mesh_.time().outputTime()) // { // weights_.write(); // } } Furthermore, I have tried to make a small testProgram (you could term it a unit test) that only contains this one single class and its derivatives. Suddenly, the field is written correctly, so the observed error is not reproducible in a different context. Anyone who has experienced the same behaviour and who knows a solution to it? Kind regards, Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. |
|
April 9, 2015, 10:27 |
|
#2 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37 |
Thank you for your attention.
I have solved the problem, because I suddenly realised that I used part of the functionality of the same class elsewhere, i.e. the field was created twice, but only updated in one of the versions. Consequently I had introduced the conflict myself. Kind regards, Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to update a volScalarField's values | ThomasV | OpenFOAM Programming & Development | 9 | March 10, 2020 12:51 |
Values for nu t and nu tilda | Phizz82 | OpenFOAM Running, Solving & CFD | 1 | March 2, 2020 06:00 |
How can I write out a volscalarfield in openFOAM | Marshak | OpenFOAM Programming & Development | 3 | August 29, 2013 14:10 |
Counting non-zero values in a volScalarField | javier_motta | OpenFOAM | 1 | May 29, 2013 10:30 |
strange node values @ solid/fluid interface - help | JB | FLUENT | 2 | November 1, 2008 12:04 |