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

Modifying solidificationMeltingSource for Mushy zone phasechange

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   January 30, 2017, 09:07
Post Modifying solidificationMeltingSource for Mushy zone phasechange
  #1
Member
 
a
Join Date: Oct 2014
Posts: 49
Rep Power: 11
cfd@kgp is on a distinguished road
Hi Foam experts,

I was trying to modify the solidificationMeltingSource (Isothermal ohase change source) for the mushy ploblems in OpenFoam version 3.0.

I was successful till defining the liquid fraction using Tsolidus and Tliquidus.

But some how I am unable to get the "Phi field" in order to add the term " fvc::div(phi, alpha1_))" in solidificationMeltingSourceTemplates.C.

Code:
\*---------------------------------------------------------------------------*/

#include "fvMatrices.H"
#include "fvcDdt.H"
#include "fvcDiv.H"


// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //

template<class RhoFieldType>
void Foam::fv::mushysolidificationMeltingSource::apply
(

    const RhoFieldType& rho,
    fvMatrix<scalar>& eqn
)
{
    if (debug)
    {
        Info<< type() << ": applying source to " << eqn.psi().name() << endl;
    }

    const volScalarField Cp(this->Cp());

    update(Cp);

    dimensionedScalar L("L", dimEnergy/dimMass, L_);

    // contributions added to rhs of solver equation
    if (eqn.psi().dimensions() == dimTemperature)
    {
        // isothermal phase change - only include time derivative
         eqn -= L/Cp*(fvc::ddt(rho, alpha1_) + fvc::div(phi, alpha1_)); //mushy phase change  
      //  eqn -= L/Cp*(fvc::ddt(rho, alpha1_));
    }
    else
    {
        // isothermal phase change - only include time derivative
         eqn -= L*(fvc::ddt(rho, alpha1_) + fvc::div(phi, alpha1_)); //mushy phase change  
       // eqn -= L*(fvc::ddt(rho, alpha1_));
    }
}


// ************************************************************************* //
I get following compilation error,

Code:
In file included from sources/derived/mushysolidificationMeltingSource/mushysolidificationMeltingSource.H:269:0,
                 from sources/derived/mushysolidificationMeltingSource/mushysolidificationMeltingSource.C:26:
sources/derived/mushysolidificationMeltingSource/mushysolidificationMeltingSourceTemplates.C: In member function ‘void Foam::fv::mushysolidificationMeltingSource::apply(const RhoFieldType&, Foam::fvMatrix<double>&)’:
sources/derived/mushysolidificationMeltingSource/mushysolidificationMeltingSourceTemplates.C:56:57: error: ‘phi’ was not declared in this scope
          eqn -= L/Cp*(fvc::ddt(rho, alpha1_) + fvc::div(phi, alpha1_)); //mushy phase change 
                                                         ^
sources/derived/mushysolidificationMeltingSource/mushysolidificationMeltingSourceTemplates.C:62:54: error: ‘phi’ was not declared in this scope
          eqn -= L*(fvc::ddt(rho, alpha1_) + fvc::div(phi, alpha1_)); //mushy phase change 
                                                      ^
sources/derived/mushysolidificationMeltingSource/mushysolidificationMeltingSource.C: In member function ‘void Foam::fv::mushysolidificationMeltingSource::update(const volScalarField&)’:
sources/derived/mushysolidificationMeltingSource/mushysolidificationMeltingSource.C:170:16: warning: unused variable ‘Cpc’ [-Wunused-variable]
         scalar Cpc = Cp[cellI];
                ^
make: *** [Make/linuxGccDPInt32Opt/sources/derived/mushysolidificationMeltingSource/mushysolidificationMeltingSource.o] Error 1
I have included the header file for the divergence term fvcDiv.H. should I include any other header file?

Thanks in advance.
kindly help
cfd@kgp is offline   Reply With Quote

 

Tags
melting openfoam, solidification, solidification/melting


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
[Commercial meshers] Mesh conversion problem (fluent3DMeshToFoam) Aadhavan OpenFOAM Meshing & Mesh Conversion 2 March 8, 2018 01:47
Possible Bug in pimpleFoam (or createPatch) (or fluent3DMeshToFoam) cfdonline2mohsen OpenFOAM 3 October 21, 2013 09:28
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem Attesz OpenFOAM Meshing & Mesh Conversion 12 May 2, 2013 10:52
Problem in running ICEM grid in Openfoam Tarak OpenFOAM 6 September 9, 2011 17:51
Problem in IMPORT of ICEM input file in FLUENT csvirume FLUENT 2 September 9, 2009 01:08


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