CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

dimension problem in reactingParcelFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By H.Tofighian

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 16, 2020, 12:23
Default dimension problem in reactingParcelFoam
  #1
Senior Member
 
Farzad Faraji
Join Date: Nov 2019
Posts: 204
Rep Power: 7
farzadmech is on a distinguished road
Dear friends
I was working with reactingParcelFoam and I realized that the main equation for species transport has dimension probem. The main equation from YEqn.H is;

Code:
            fvScalarMatrix YEqn
            (
                fvm::ddt(rho, Yi)
              + mvConvection->fvmDiv(phi, Yi)
              - fvm::laplacian(turbulence->muEff(), Yi)
              ==
                parcels.SYi(i, Yi)
              + fvOptions(rho, Yi)
              + combustion->R(Yi)
              + surfaceFilm.Srho(i)
            );
fvm::ddt(rho, Yi) dimension is Mass/Volume/Time and the parcels.SYi(i, Yi) dimension is Mass/Time. In order to be confidant about dimension of the parcels.SYi(i, Yi), I have copied the SYi function from ReactingCloudI.H as below;
Code:
 tmp<fvScalarMatrix> tfvm(new fvScalarMatrix(Yi, dimMass/dimTime));
or;

Code:
template<class CloudType>
inline Foam::tmp<Foam::fvScalarMatrix> Foam::ReactingCloud<CloudType>::SYi
(
    const label i,
    volScalarField& Yi
) const
{
    if (this->solution().coupled())
    {
        if (this->solution().semiImplicit("Yi"))
        {
            tmp<volScalarField> trhoTrans
            (
                new volScalarField
                (
                    IOobject
                    (
                        this->name() + ":rhoTrans",
                        this->db().time().timeName(),
                        this->db(),
                        IOobject::NO_READ,
                        IOobject::NO_WRITE,
                        false
                    ),
                    this->mesh(),
                    dimensionedScalar("zero", dimMass/dimTime/dimVolume, 0.0)
                )
            );

            volScalarField& sourceField = trhoTrans.ref();

            sourceField.primitiveFieldRef() =
                rhoTrans_[i]/(this->db().time().deltaTValue()*this->mesh().V());

            const dimensionedScalar Yismall("Yismall", dimless, small);

            return
                fvm::Sp(neg(sourceField)*sourceField/(Yi + Yismall), Yi)
              + pos0(sourceField)*sourceField;
        }
        else  // if (this->solution().semiImplicit("Yi"))

        {
            tmp<fvScalarMatrix> tfvm(new fvScalarMatrix(Yi, dimMass/dimTime));
            fvScalarMatrix& fvm = tfvm.ref();

            fvm.source() = -rhoTrans_[i]/this->db().time().deltaTValue();

            return tfvm;
        }
    }

    return tmp<fvScalarMatrix>(new fvScalarMatrix(Yi, dimMass/dimTime));
}
Do you have any suggestion why it does not give dimension error?


Thanks,
Farzad
farzadmech is offline   Reply With Quote

Old   March 16, 2020, 18:56
Default
  #2
New Member
 
Hesam Tofighian
Join Date: Mar 2019
Posts: 11
Rep Power: 7
H.Tofighian is on a distinguished road
Are you try to multiply the source term by a arbitrary dimension? maybe it is not sensitive to dimension!
farzadmech likes this.
H.Tofighian is offline   Reply With Quote

Old   March 17, 2020, 15:51
Default
  #3
Senior Member
 
Farzad Faraji
Join Date: Nov 2019
Posts: 204
Rep Power: 7
farzadmech is on a distinguished road
Thanks for your answer. I checked what you said. source term is completely sensitive to dimension, and whenever I change it, I got error so basically this is not the case.

Quote:
Originally Posted by H.Tofighian View Post
Are you try to multiply the source term by a arbitrary dimension? maybe it is not sensitive to dimension!
farzadmech is offline   Reply With Quote

Old   March 17, 2020, 16:01
Default Yet another dimension problem
  #4
Senior Member
 
Farzad Faraji
Join Date: Nov 2019
Posts: 204
Rep Power: 7
farzadmech is on a distinguished road
Dear friends
I have found another problem in the KinematicCloudI.H which I will be very thankful if you know the answer;

Code:
if (this->solution().coupled())
    {
        if (this->solution().semiImplicit("Yi"))
        {
            tmp<volScalarField> trhoTrans
            (
                new volScalarField
                (
                    IOobject
                    (
                        this->name() + ":rhoTrans",
                        this->db().time().timeName(),
                        this->db(),
                        IOobject::NO_READ,
                        IOobject::NO_WRITE,
                        false
                    ),
                    this->mesh(),
                    dimensionedScalar("zero", dimMass/dimTime/dimVolume, 0.0)
                )
            );

            volScalarField& sourceField = trhoTrans.ref();

            sourceField.primitiveFieldRef() =
                rhoTrans_[i]/(this->db().time().deltaTValue()*this->mesh().V());

            const dimensionedScalar Yismall("Yismall", dimless, small);

            return
                fvm::Sp(neg(sourceField)*sourceField/(Yi + Yismall), Yi)
              + pos0(sourceField)*sourceField;
        }
        else   //         if (this->solution().semiImplicit("Yi"))
        {
            tmp<fvScalarMatrix> tfvm(new fvScalarMatrix(Yi, dimMass/dimTime));
            fvScalarMatrix& fvm = tfvm.ref();

            fvm.source() = -rhoTrans_[i]/this->db().time().deltaTValue();

            return tfvm;
        }
    }
My question is that why the dimension of "if" is dimMass/dimTime/dimVolume and dimension of "else" is dimMass/dimTime.

Thanks,
Farzad
farzadmech is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fluent Parallelization Problem After AC Power Dropped pawl Hardware 5 November 13, 2016 06:08
A problem using reactingParcelFoam to simulate turbulence liyuthu OpenFOAM Running, Solving & CFD 1 February 3, 2016 10:43
Problem Importing Geometry ProE to CFX fatb0y CFX 3 January 14, 2012 19:42
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13


All times are GMT -4. The time now is 06:49.