|
[Sponsors] |
Modifying solidificationMeltingSource for Mushy zone phasechange |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 30, 2017, 09:07 |
Modifying solidificationMeltingSource for Mushy zone phasechange
|
#1 |
Member
a
Join Date: Oct 2014
Posts: 49
Rep Power: 11 |
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_)); } } // ************************************************************************* // 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 Thanks in advance. kindly help |
|
Tags |
melting openfoam, solidification, solidification/melting |
|
|
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 |