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/)
-   -   multiphaseInterFoam access to alpha.water (https://www.cfd-online.com/Forums/openfoam-programming-development/136830-multiphaseinterfoam-access-alpha-water.html)

Martin_K_lalelu June 5, 2014 04:45

multiphaseInterFoam access to alpha.water
 
Hi all,

to modify the multiphaseInterFoam solver I'm trying to use alpha.water in the UEqn.
How can I adress it?

My approach:
Code:

volScalarField& alphaWater = objectRegistry::lookupObject<volScalarField>("alpha.water");
Any advices, explanations or links to understand how to read values out of fields will be appreciated!

Edit:
Compilation error:
Quote:

cannot call member function ‘const Type& Foam::objectRegistry::lookupObject(const Foam::word&) const [with Type = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>]’ without object

bbita October 19, 2017 21:26

Hi Martin,

Could you find answer to your question? I am trying to address alpha of my first phase.

Thanks

MrFyzzix November 3, 2017 06:45

I am struggling with the same problem. Any help would be welcome!

bbita November 3, 2017 10:00

Hi Gary,

You have to include your changes e.g. new parameter in multiphaseMixture.

MrFyzzix November 8, 2017 10:30

Thanks for your comment, bbita. I tried it, but I did not get it to work. I am not an experienced programmer. Could you show me how you solved it?

bbita November 8, 2017 10:37

Hi gary,

It completely depends on the changes you want to apply in your code. I suggest you to understand different sections in the file. For instance, if you want to add a new parameter, you can do that similar to the way that rho is defined.

jpeter3 November 9, 2017 16:30

Hay!

If i remember correctly, in interMultiphaseFoam, all the phase fields are stored in phases_ of multiphaseMixture.

So accessing one of them would probably look like:

volScalarField& alphaWater= mixture.phases()["water"];

mixture - name of multiphaseMixture class
phases() - returns PtrDictionary<phase> phases_
["sth"] - looks if there is a phase that has a name "sth" in phases_, and returns it


hope it helps


All times are GMT -4. The time now is 16:20.