Open robertsawko opened 8 years ago
Right, it seems we have a serious validity and performance issue when using phaseModel
. Phase model retunrs only tmp<scalarField>
objects from this. We are saving references to these objects but I presume they get destroyed later on and our references become hanging pointers(?).
The way to solve is to call directly
return impl_.S(xi1.value(),
xi2.value(),
epsilonField[celli],
dispersedPhase_.rho()[celli],
dispersedPhase_.nu()()[celli],
phase_.U().mesh().V()[celli]);
There's a big difference between rho
and nu
up there. rho
is already calculated and we just access specific variable. nu
has to precomputed every time for the whole field only for us to pick a single value.
Right, so the plan is as follows:
nud
in case of C&Cupdate
function before calculating source term fields.S
function of the kernel uses internal precalculated fields.@Kojirion , can I ask you to get your head around this problem? Please check whether we still have performance problem or if I accidentally created a memory leak. Is there a better way which would not involve an update
function at all? How do we encapsulate that functionality?
Something is wrong when it tries to read the viscosity field.