|
[Sponsors] |
July 27, 2016, 13:51 |
acces to createfields-Volscalarfields
|
#1 |
New Member
Steve
Join Date: Dec 2014
Posts: 6
Rep Power: 11 |
I Have a problem with my driftFluxFoam adaption:
Because of the modular construction of DriftFluxFoam, the viscosity Model has no direct acces to the volScalarFields of createfields. Can somebody help me to initialize a volScalarField out of createFields, or even better, get acces to createFields? |
|
July 29, 2016, 10:11 |
|
#2 |
New Member
Steve
Join Date: Dec 2014
Posts: 6
Rep Power: 11 |
To solve my problem, i tried to save an load the Objects of a dictionary. Here is my code:
In the end of createfields.H: Code:
IOdictionary bilineardict ( IOobject ( "bilineardict", runTime.constant(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ) ); volScalarField Konzentration ( IOobject ( "Konzentration", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), alpha1*rho1 ); Code:
const objectRegistry& db = mesh.thisDb(); const dictionary& transportProperties = db().lookupObject<IOdictionary> ( "bilineardict" ); |
|
July 29, 2016, 10:30 |
|
#3 |
New Member
Dominic
Join Date: May 2016
Posts: 27
Rep Power: 9 |
Can you post more of your solver (especially the beginning portion)? I presume you have either
Code:
# include "createMesh.H" Code:
# include "createDynamicFvMesh.H" If you want access to "Konzentration" in the main body of the code, you could use the lines: Code:
volVectorField Konzentration ( IOobject ( "Konzentration", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); |
|
July 29, 2016, 11:03 |
|
#4 |
New Member
Steve
Join Date: Dec 2014
Posts: 6
Rep Power: 11 |
In my main function the only thing that comes near to your suggestions is
Code:
#include "createMesh.H" Code:
#include "bilinear.H" #include "addToRunTimeSelectionTable.H" #include "fvcGrad.H" If i write Code:
volVectorField Konzentration ( IOobject ( "Konzentration", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); error: conflicting declaration ‘Foam::volVectorField Konzentration’ ( ^ bilinear/bilinear.C:97:20: error: ‘Konzentration’ has a previous declaration as ‘Foam::volScalarField Konzentration’ volScalarField Konzentration = alpha_*rho_c_; ^ bilinear/bilinear.C:119:13: error: ‘runTime’ was not declared in this scope runTime.timeName(), ^ bilinear/bilinear.C:120:13: error: ‘mesh’ was not declared in this scope mesh, I don´t get these error messages about runTime and mesh in my createFields.H |
|
July 29, 2016, 11:21 |
|
#5 |
New Member
Dominic
Join Date: May 2016
Posts: 27
Rep Power: 9 |
Did you forget to include bilinear.H in your .dep file perhaps?
|
|
July 29, 2016, 11:25 |
|
#6 | |||
New Member
Join Date: Oct 2014
Posts: 26
Rep Power: 11 |
Hi SteveFOAM,
Quote:
Quote:
Quote:
regards, teuk |
||||
August 1, 2016, 07:30 |
|
#7 |
New Member
Steve
Join Date: Dec 2014
Posts: 6
Rep Power: 11 |
The previous declaration of Konzentration was a mistake in the code. The inclusion of "fvMesh.H" had not helped me, same error. I want to be clear: I already defined everything properly in createfields. I just want to read them in bilinear.C.
The mesh and the runTime is within the main, but the inclusion of the mixtureViscosityModels is far before this runtime loop (not my idea, its driftfluxFoam) |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
create volTensorField out of volScalarFields | anton_lias | OpenFOAM Programming & Development | 5 | December 22, 2014 10:44 |
Multiple volScalarFields using List<volScalarField> | vbchris | OpenFOAM Programming & Development | 6 | September 14, 2014 06:38 |
Error with laplacian of two volScalarFields | Hisham | OpenFOAM Programming & Development | 10 | August 12, 2013 06:50 |
a reconstructPar issue | immortality | OpenFOAM Post-Processing | 8 | June 16, 2013 11:25 |
an odd(at least for me!) reconstructPar error on a field | immortality | OpenFOAM Running, Solving & CFD | 3 | June 3, 2013 22:36 |