|
[Sponsors] |
![]() |
![]() |
#21 | |
Senior Member
Gerry Kan
Join Date: May 2016
Posts: 360
Rep Power: 11 ![]() |
Quote:
As for this sub model, what you could do, is to introduce a global object (or variable) for myBeta, for instance. Your submodel will have visibility to it. Of course it is not very elegant because it this breaks encapsulation, but for the most part it works. For the C++ purists, if there is a better way of doing this (through the registry if you only need read access, for instance) I would very much like to know. Gerry. |
||
![]() |
![]() |
![]() |
![]() |
#22 | |
Senior Member
|
Hi,
When I modified the original source code as you mentioned, no error occurred with the standard tutorial "twoPhaseEulerFoam/RAS/bubbleColumn". (OS: Ubuntu 20.04;OpenFOAM v7) I added a "myBeta_" definition in header file and lookupOrDefault description in the constructor. Do you use customized libraries or something? your log says "diffusionkEpsilon" and "mysigmake" . Could you provide us with a test case you use and exact information about your environment (OS, OpenFOAM version, etc). Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#23 | |
Senior Member
|
Hi Snak,
Thanks for your reply. I solved the problem by defining mybeta same as the one I defined in the createFields due to its consistency. Out of curiosity, you defined myBeta in a phaseModel dictionary? Can you directly change the value from the phaseModel Dict in the case file? I uploaded test file here and you can have a try (you should run blockMesh firstly). In terms of diffusionKe turbulence model, it will be used in the future, thus just delete it, use the default kE model. Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#24 | |
Senior Member
|
Hi yangqi,
myBeta can be in constant/phaseProperties dict. The phaseProperties dict is attached. (phaseProperties.zip) The modified code is attached as phaseModel.zip. With these files, you can get the log like this, Code:
from phseModel.C in air myBeta = 1 Calculating face flux field phi.air Selecting diameterModel for phase air: isothermal Selecting turbulence model type RAS Selecting RAS turbulence model mixtureKEpsilon RAS { RASModel mixtureKEpsilon; turbulence on; printCoeffs on; Cmu 0.09; C1 1.44; C2 1.92; C3 1.92; Cp 0.25; sigmak 1; sigmaEps 1.3; } Selecting thermodynamics package { type heRhoThermo; mixture pureMixture; transport const; thermo eConst; equationOfState perfectFluid; specie specie; energy sensibleInternalEnergy; } from phseModel.C in water myBeta = 0.1 Calculating face flux field phi.water Quote:
ADDED: You changed Make/options files. If some library or solver include original twoPhaseSystem which is not consistent with your modified twoPhaseSystem, you may have the error you posted before. |
||
![]() |
![]() |
![]() |
![]() |
#25 | |
Senior Member
|
Thanks for your attention. I also tried in this way, no compiling error occurs but you could not call myBeta in another file. For example, I need to use myBeta in phasePair.C. One thing I am confused that the default alphaMax is also a scalar already defined and function alphaMax() also defined in phaseModel.H. However, when you define myBeta, no this procedure?
Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#26 |
Senior Member
|
hi,
After you modified phaseModel.H, you have to recompile all libraries including the phaseModel.H. Otherwise, info inside libraries will not coincide. even if you have above problem, there will be no error at compilation. Each libraries is correct. However, at run-time, there will be discrepancy. your Make/options file looks very complex. you have to be very careful, i guess. |
|
![]() |
![]() |
![]() |
![]() |
#27 |
New Member
rakki reddy
Join Date: Sep 2020
Posts: 1
Rep Power: 0 ![]() |
I accomplished something comparative in my solver, in which I read in word reference esteems and burden them in toward the beginning of the solver before the time circle. I gathered these custom settings in a different word reference and read them in like manner. This worked for me. From what I have found in your code, it appears to be that you are attempting to set up these keys in the default word references (e.g., control diet or evolution, to be straightforward I don't have the foggiest idea what they are called). I for one don't have the foggiest idea whether you can alter these default word references. This is the reason I proposed making a different word reference for your own settings.
|
|
![]() |
![]() |
![]() |
Tags |
phasemodel, twophaseeuelrfoam, twophasesystem |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' | muth | OpenFOAM Running, Solving & CFD | 3 | August 27, 2018 04:18 |
Division by zero exception - loop over scalarField | Pat84 | OpenFOAM Programming & Development | 6 | February 18, 2017 05:57 |
Issue symmetryPlane 2.5d extruded airfoil simulation | 281419 | OpenFOAM Running, Solving & CFD | 5 | November 28, 2015 13:09 |
Diverging solution in transonicMRFDyMFoam | tsalter | OpenFOAM Running, Solving & CFD | 30 | July 7, 2014 06:20 |
compressible flow in turbocharger | riesotto | OpenFOAM | 50 | May 26, 2014 01:47 |