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/)
-   -   Thermophysical transport model to include shear rate (https://www.cfd-online.com/Forums/openfoam-programming-development/165933-thermophysical-transport-model-include-shear-rate.html)

Janez Turk January 29, 2016 13:19

Thermophysical transport model to include shear rate
 
Greetings!

I'm currently working on new thermophysical model with its own equation of state and transport properties. I get stuck when I try to implement shear rate dependence of viscosity. Is this feasible? Where would you calculate shear rate and pass it to viscosity function? Goal is to capture shear thinning behaviour of polymers with multiphase flow.

This is where ("/src/thermophysicalModels/specie/transport/crossWLF/crossWLFTransportI.H") viscosity is evaluated. It takes p and T.
Code:

template<class Thermo>
inline Foam::scalar Foam::crossWLFTransport<Thermo>::mu
(
    const scalar p,
    const scalar T
) const
{
    return D1_*::exp(-(A1_*(T-D2_))/(A2_+T-D2_));
}

This is file /src/thermophysicalModels/basic/rhoThermo/heRhoThermo.H, where I suppose mu is called.

Code:

template<class BasicPsiThermo, class MixtureType>
void Foam::heRhoThermo<BasicPsiThermo, MixtureType>::calculate()
{
    const scalarField& hCells = this->he().internalField();
    const scalarField& pCells = this->p_.internalField();
    //const vectorField& UCells = this->U_.internalField(); ofcourse it doesn't work like this

    scalarField& TCells = this->T_.internalField();
    scalarField& psiCells = this->psi_.internalField();
    scalarField& rhoCells = this->rho_.internalField();
    scalarField& muCells = this->mu_.internalField();
    scalarField& alphaCells = this->alpha_.internalField();

    forAll(TCells, celli)
    {
        const typename MixtureType::thermoType& mixture_ =
            this->cellMixture(celli);

        TCells[celli] = mixture_.THE
        (
            hCells[celli],
            pCells[celli],
            TCells[celli]
        );

        psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]);
        rhoCells[celli] = mixture_.rho(pCells[celli], TCells[celli]);

        muCells[celli] = mixture_.mu(pCells[celli], TCells[celli]); // is this the line where mu is called?
        alphaCells[celli] = mixture_.alphah(pCells[celli], TCells[celli]);
    }

Thank you!

malv83 March 6, 2018 03:44

Hi Janez,

Were you able to implement this modification?

Thanks

Janez Turk March 18, 2018 09:41

Hello sir,

yes we managed, source code can be downloaded:

https://github.com/krebeljk/openInjMoldSim

Regards,
Janez Turk

derekm March 24, 2018 11:30

Is there a way to create a new thermomodel without having to modify the solver to reference it? I'm trying to create a modified version of heSolidThermo but cant see a way round modifying the solvers to reference a new version solidThermo as well


All times are GMT -4. The time now is 08:18.