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/)
-   -   Coupling interFoam and DPMFoam (https://www.cfd-online.com/Forums/openfoam-programming-development/168398-coupling-interfoam-dpmfoam.html)

lilinmin March 21, 2016 08:27

Coupling interFoam and DPMFoam
 
Hi,
I am trying to incorporate the interFoam and DPMFoam to simulate the air-water-particles systems. I want to create the viscosity field of continuous phases using the mixture law.

volScalarField muc
(
IOobject
(
"muc",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
alpha1*rho1*"nu1" + alpha2*rho2*"nu2",
alpha1.boundaryField().types()
);

but I am in trouble with reading "nu" from "transportProperties" file.
Anyone can help me?

if anyone has similar codes for the Multiphase-DPM coupled problem and share here, it will be very helpful.

Thank you very much!

Linmin

sharonyue March 22, 2016 06:19

Quote:

Originally Posted by lilinmin (Post 590869)
Hi,
I am trying to incorporate the interFoam and DPMFoam to simulate the air-water-particles systems. I want to create the viscosity field of continuous phases using the mixture law.

volScalarField muc
(
IOobject
(
"muc",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
alpha1*rho1*"nu1" + alpha2*rho2*"nu2",
alpha1.boundaryField().types()
);

but I am in trouble with reading "nu" from "transportProperties" file.
Anyone can help me?

if anyone has similar codes for the Multiphase-DPM coupled problem and share here, it will be very helpful.

Thank you very much!

Linmin

Hi Linmin,

From your code, you can just use:

Code:

twoPhaseProperties.mu();
to calculate mu. It has already been implemented in incompressibleTwoPhaseMixture class.

:)

lilinmin March 22, 2016 06:30

Quote:

Originally Posted by sharonyue (Post 591037)
Hi Linmin,

From your code, you can just use:

Code:

twoPhaseProperties.mu();
to calculate mu. It has already been implemented in incompressibleTwoPhaseMixture class.

:)

twoPhaseProperties.mu(); It returns the "mu" of mixture? And if it is calculated according to "alpha1*rho1*nu1+alpha2*rho2*nu2"?

sharonyue March 22, 2016 06:36

Quote:

Originally Posted by lilinmin (Post 591041)
twoPhaseProperties.mu(); It returns the "mu" of mixture? And if it is calculated according to "alpha1*rho1*nu1+alpha2*rho2*nu2"?

Yep, it has beed defined here:
Code:

Foam::tmp<Foam::volScalarField>
Foam::incompressibleTwoPhaseMixture::mu() const
{
    const volScalarField limitedAlpha1
    (
        min(max(alpha1_, scalar(0)), scalar(1))
    );

    return tmp<volScalarField>
    (
        new volScalarField
        (
            "mu",
            limitedAlpha1*rho1_*nuModel1_->nu()
          + (scalar(1) - limitedAlpha1)*rho2_*nuModel2_->nu()
        )
    );
}

For more info check it here if u understand Chinese, Eq.(21): http://www.dyfluid.com/interFoam.html

:D

lilinmin March 22, 2016 06:44

Quote:

Originally Posted by sharonyue (Post 591046)
Yep, it has beed defined here:
Code:

Foam::tmp<Foam::volScalarField>
Foam::incompressibleTwoPhaseMixture::mu() const
{
    const volScalarField limitedAlpha1
    (
        min(max(alpha1_, scalar(0)), scalar(1))
    );

    return tmp<volScalarField>
    (
        new volScalarField
        (
            "mu",
            limitedAlpha1*rho1_*nuModel1_->nu()
          + (scalar(1) - limitedAlpha1)*rho2_*nuModel2_->nu()
        )
    );
}

For more info check it here if u understand Chinese, Eq.(21): http://www.dyfluid.com/interFoam.html

:D

I write the code as:
volScalarField muc
(
IOobject
(
"muc",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
twoPhaseProperties.mu(),
alpha1.boundaryField().types()
);
But it shows the error: " ‘twoPhaseProperties’ was not declared"
Very sorry to interrupt again! And you documents are very helpful!
Thank you very much !

sharonyue March 22, 2016 07:04

hi

i will give u a more explaination after i finish my dinner.

:)

lilinmin March 22, 2016 08:12

Quote:

Originally Posted by sharonyue (Post 591056)
hi

i will give u a more explaination after i finish my dinner.

:)

Thank you very much again, and looking forward to your explanation!

lilinmin March 22, 2016 21:30

Quote:

Originally Posted by sharonyue (Post 591056)
hi

i will give u a more explaination after i finish my dinner.

:)

According to your suggestion, I have added:

incompressibleTwoPhaseMixture twoPhaseProperties(U, phi);

and used the code:

twoPhaseProperties.mu(),

to read the viscosity of mixture and successfully complied the code.
Thank you very much again for your help and your web is very helpful.
Linmin


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