CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   request fo volVectorField U.particles from objectRegistry regin0 failed-TwoPhaseEuler (https://www.cfd-online.com/Forums/openfoam-programming-development/229326-request-fo-volvectorfield-u-particles-objectregistry-regin0-failed-twophaseeuler.html)

Hamed1117 August 4, 2020 16:38

request fo volVectorField U.particles from objectRegistry regin0 failed-TwoPhaseEuler
 
Hi Foamers,

I need to get access to U.particles in order to calculate the shear rate somewhere inside the viscosity model for twoPhaseEulerFoam solver.

I use the following object registry utility for U field as :

const volVectorField& U = this ->db().objectRegistry::lookupObject<volVectorField> ("U.particles");

The problem, however, arises when I call U.particles for twoPhaseEulerFoam solver getting the following error message:

--> FOAM FATAL ERROR:

request for volVectorField U.particles from objectRegistry region0 failed
available objects of type volVectorField are
0()



I am pretty sure that the process of the U object registry is fine since other two-phase solvers (e.g. compressibleInterFoam) reads U field from 0/. folder through applying the same viscosity model.

I used the mentioned registry for all the twoPhaseEulerFoam/tutorials, but none of them read volVectorField U from 0/ but compressibleInterFoam/tutorials work fine.

Plus, comparing creatFields.H for two multiphase solvers (e.g compressibleInterFoam with twoPhaseEulerFoam) shows a major difference in the field declaration order that could be the possible reason for the problem.

any suggestions would be greatly appreciated.

Hamed1117 August 6, 2020 15:16

I Solved the problem using the following procedure:

1- Since the object registry of U field is required for calculating of the shear rate (SR), it would be more efficient to use the available U field inside the twoPhaseEuler.C (not inside the thermophysical model)
2- As the shear rate (SR) is calculated inside the main solver, it can be easily transferred to the needed address (e.g. thermophysicalModels/basic/heRhoThermo/viscosity_calculation)

NFisc January 28, 2021 11:52

Quote:

Originally Posted by Hamed1117 (Post 779792)
I Solved the problem using the following procedure:

1- Since the object registry of U field is required for calculating of the shear rate (SR), it would be more efficient to use the available U field inside the twoPhaseEuler.C (not inside the thermophysical model)
2- As the shear rate (SR) is calculated inside the main solver, it can be easily transferred to the needed address (e.g. thermophysicalModels/basic/heRhoThermo/viscosity_calculation)


Hello Hamed,


I try to do the same thing and I am stuck at the same part as you did. Can you explain your solution more detailled and maybe share your /basic, /specie and the twoPhaseEuler solver in case you modified something there?


Thank you very much for the help,


Niko

Anamika July 7, 2021 04:31

A non-newtonian viscosity for thermophysicalModels
 
Quote:

Originally Posted by Hamed1117 (Post 779792)
I Solved the problem using the following procedure:

1- Since the object registry of U field is required for calculating of the shear rate (SR), it would be more efficient to use the available U field inside the twoPhaseEuler.C (not inside the thermophysical model)
2- As the shear rate (SR) is calculated inside the main solver, it can be easily transferred to the needed address (e.g. thermophysicalModels/basic/heRhoThermo/viscosity_calculation)




Hello Hamed,



I am also trying to use viscosity as a function of shear rate and phase fraction. I went through your suggestion but still getting a compilation error. I request you to please do share a your heRhoThermo.C and main Solver.C file. It would be a great help. Thank you.

Anamika October 9, 2021 15:25

Viscosity as A Function of Shear Rate in TwoPhaseEulerFoam
 
1 Attachment(s)
Quote:

Originally Posted by Hamed1117 (Post 779792)
I Solved the problem using the following procedure:

1- Since the object registry of U field is required for calculating of the shear rate (SR), it would be more efficient to use the available U field inside the twoPhaseEuler.C (not inside the thermophysical model)
2- As the shear rate (SR) is calculated inside the main solver, it can be easily transferred to the needed address (e.g. thermophysicalModels/basic/heRhoThermo/viscosity_calculation)

Hello Hamed, I am still figuring out if you have used U1 or U2 as an available U field to calculate SR. I used the U1 velocity field in the main solver and the solver got compiled successfully but it shows an error as the "SR.particle" file is missing.

It would be a great help if you can help me to figure it out. Hoping for the best!
Thank you in advance.

Regards,
Anamika


All times are GMT -4. The time now is 01:51.