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

Adding the Energy Equation to interFoam (OF 2.4.0)

Register Blogs Community New Posts Updated Threads Search

Like Tree22Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 19, 2015, 12:37
Default
  #21
Senior Member
 
mkraposhin's Avatar
 
Matvey Kraposhin
Join Date: Mar 2009
Location: Moscow, Russian Federation
Posts: 355
Rep Power: 21
mkraposhin is on a distinguished road
@ Hannah and Perry:
I need some time to write equations to show you what seems wrong to me when we use energy equation, formulated with mass fluxes
mkraposhin is offline   Reply With Quote

Old   November 20, 2015, 12:23
Default
  #22
Senior Member
 
mkraposhin's Avatar
 
Matvey Kraposhin
Join Date: Mar 2009
Location: Moscow, Russian Federation
Posts: 355
Rep Power: 21
mkraposhin is on a distinguished road
First of all, i would like to post derivation of mixture equation for temperature.

As you can see, it is possible to derive equations without using mass fluxes and heat capacities in fluxes expressions.

Why i don't like mass fluxes?

Because interFoam's pressure equation solves for volumetric fluxes. Until your densities are constant (doesn't depends on temperature), you can easilly construct mass flux which satisfies mass continuity.

But for other cases you will get in "trouble"
Attached Files
File Type: pdf two phase balances.pdf (44.6 KB, 327 views)
atulkjoy likes this.
mkraposhin is offline   Reply With Quote

Old   December 21, 2015, 13:34
Default fireFoam
  #23
Member
 
Atul Kumar
Join Date: Dec 2015
Location: National Centre for Combustion Research and Development
Posts: 48
Rep Power: 10
atulkjoy is on a distinguished road
Hi,
I want to model small pool fire 2d case with methanol. for steady state flame propagation I want to implement interface boundary condition with on FireFoam.
1. conduction by flame = latent heat* velocity
2.stefan boundary condition with velovity == diffusion*mass fraction grad/1-mass fraction.
3.Clausius-Clapeyron equation.
Can any body help how should I proceed ?????????????????????
atulkjoy is offline   Reply With Quote

Old   December 22, 2015, 07:18
Default
  #24
Pay
New Member
 
Perry Uhlig
Join Date: Oct 2015
Location: Germany
Posts: 13
Rep Power: 10
Pay is on a distinguished road
Hello Atul,
this thread's topic has nearly nothing in common with your post.
Please only make posts where it fits to the topic and/or start a new thread.
Also have a look whether you find tutorials on the wiki or somewhere else.
Pay is offline   Reply With Quote

Old   January 4, 2016, 11:21
Default
  #25
Pay
New Member
 
Perry Uhlig
Join Date: Oct 2015
Location: Germany
Posts: 13
Rep Power: 10
Pay is on a distinguished road
@ Hannah

I had another look on my own and also your case setup of the 2D damTempBreak case.
Apart from that we use our own solvers, which should be also the same except the OpenFOAM version, I adjusted the last details to your setup.

And still when I view the results in paraview e.g. after 0.5 sec AND RESCALE the caption I can see temperatures below minimum temperature and above maximum temperature of the starting condition (which is physically impossible).
Hannah, could you please review your damTempBreak case and tell if you make the same observation?

I am attaching pictures of temperatur field for 0 and 0.5 sceonds and my case file.

damTempBreak_0sec.jpg

damTempBreak_0_5sec.jpg

damTempBreakCASE.tar.gz
Pay is offline   Reply With Quote

Old   February 10, 2016, 14:41
Default
  #26
New Member
 
Hannah Dietterich
Join Date: Mar 2015
Posts: 8
Rep Power: 11
hdietterich is on a distinguished road
I just checked, and I do see that effect, although not nearly as extreme as that. With initial fluid temperatures of 270 and 300 K, I end up with fluids with maximum and minimum temperatures of ~267 and 301 K (see attached plot). I didn't notice this before, since ParaView didn't change the scale by default.

However, for my actual viscous fluid extrusion simulations the effect seems to be negligible (min 293.15 K ambient air, max 315.15 K input fluid). There's a brief excursion about halfway through the simulation, but the model recovers and the minimum and maximum temperatures are otherwise very steady and accurate (see attached plot).

Perhaps the wandering temperatures are due to small numerical errors that add up from poor mesh or temporal resolution in the damBreakTemp case? For my purposes it's definitely given very good results.
Attached Files
File Type: pdf minmaxT_box.pdf (6.4 KB, 88 views)
File Type: pdf minmakT_dambreak.pdf (2.8 KB, 83 views)
hdietterich is offline   Reply With Quote

Old   February 11, 2016, 03:31
Default
  #27
Pay
New Member
 
Perry Uhlig
Join Date: Oct 2015
Location: Germany
Posts: 13
Rep Power: 10
Pay is on a distinguished road
Well I cannot explain why the whole aproach seems to have worked in previous versions of OF an still works ok in 2.3 while it doesn't in 2.4.0.

Quote:
Perhaps the wandering temperatures are due to small numerical errors that add up from poor mesh or temporal resolution in the damBreakTemp case?
Concerning bad mesh ... I used blockMesh generating a nearly equidistant 2D quad mesh, I cannot imagine how this should be a bad mesh.
Pay is offline   Reply With Quote

Old   March 8, 2016, 15:31
Default
  #28
New Member
 
Rimsha
Join Date: Jan 2016
Posts: 25
Rep Power: 10
block is on a distinguished road
Quote:
Originally Posted by Pay View Post
Dear Foamers,

first of all, this is my first thread, me being new to OF and the forum as well. So I am thankful for any advice regarding anything related to CFD in general and OF and this forum in particular.

Adding the Energy Equation to interFaom makes it necessary to modify the used library (A) and secondly modify the solver itself (B). I am having problems compiling said application, hence I have written this thread.
I am going to describe my steps in detail in this thread. The procedure is inspired by both the documents from Damiano Natali ("interTempFoam") and Qingming Liu ("myinterFoamDiabatic"). The links are given beneath.

http://www.wolfdynamics.com/images/c...erTempFoam.pdf

http://www.tfd.chalmers.se/~hani/kur...gLIU-final.pdf

A) Modifcation of the library

1)
Copy the original folder transportModels to the user's directory

cd $WM_PROJECT_USER_DIR/src/
cp -rp $FOAM_SRC/transportModels .

2)
Rename the folders and files which are being modified (namely the libraries incompressibleTwoPhaseMixture and immiscibleIncompressibleTwoPhaseMixture).

cd transportModels/incompressible
mv incompressibleTwoPhaseMixture myIncompressibleTwoPhaseMixture
cd myIncompressibleTwoPhaseMixture
mv incompressibleTwoPhaseMixture.C myIncompressibleTwoPhaseMixture.C
mv incompressibleTwoPhaseMixture.H myIncompressibleTwoPhaseMixture.H

cd ../..
mv immiscibleIncompressibleTwoPhaseMixture myImmiscibleIncompressibleTwoPhaseMixture
cd myImmiscibleIncompressibleTwoPhaseMixture
mv immiscibleIncompressibleTwoPhaseMixture.C myImmiscibleIncompressibleTwoPhaseMixture.C
mv immiscibleIncompressibleTwoPhaseMixture.H myImmiscibleIncompressibleTwoPhaseMixture.H

3)
Change the respective file files corresponding to the the naming and path.
in the folder incompressible/Make for myIncompressibleTwoPhaseMixture:
Code:
myIncompressibleTwoPhaseMixture/myIncompressibleTwoPhaseMixture.C 

LIB = $(FOAM_USER_LIBBIN)/libmyIncompressibleTransportModels
in the folder myImmiscibleIncompressibleTwoPhaseMixture/Make for myImmiscibleIncompressibleTwoPhaseMixture:
Code:
myImmiscibleIncompressibleTwoPhaseMixture.C 

LIB = $(FOAM_USER_LIBBIN)/libmyImmiscibleIncompressibleTwoPhaseMixture
4) Make sure the newly named files are being included with their new name in the respective files:
in myIncompressibleTwoPhaseMixture.C:
Code:
#include "myIncompressibleTwoPhaseMixture.H"
in myImmiscibleIncompressibleTwoPhaseMixture.C
Code:
#include "myImmiscibleIncompressibleTwoPhaseMixture.H"
in myImmiscibleIncompressibleTwoPhaseMixture.H
Code:
#include "myIncompressibleTwoPhaseMixture.H"
5)
In the file myImmiscibleIncompressibleTwoPhaseMixture/Make/options make the adaption as highlighted, so the connection to the new library is made.
Code:
LIB_LIBS = \
    -ltwoPhaseMixture \
    -L$(FOAM_USER_LIBBIN) \
    -lmyIncompressibleTransportModels \
    -linterfaceProperties \
    -ltwoPhaseProperties \
    -lfiniteVolume
6)
Add the new parameters rho and Pr in myIncompressibleTwoPhaseMixture.H.
Code:
    dimensionedScalar rho1_; 
    dimensionedScalar rho2_; 
//-----------modified_start------------//
    dimensionedScalar cp1_; 
    dimensionedScalar cp2_; 
    dimensionedScalar Pr1_; 
    dimensionedScalar Pr2_;
//-----------modified_end------------//
and
Code:
    const dimensionedScalar& rho2() const 
    { 
    return rho2_; 
    }; 
//-----------modified_start------------// 
        //- Return const-access to phase1 density 
        const dimensionedScalar& cp1() const 
        { 
            return cp1_; 
        } 

        //- Return const-access to phase2 density 
        const dimensionedScalar& cp2() const 
        { 
            return cp2_; 
        }; 

        //- Return const-access to phase1 density 
        const dimensionedScalar& Pr1() const 
        { 
            return Pr1_; 
        } 

        //- Return const-access to phase2 density 
        const dimensionedScalar& Pr2() const 
        { 
            return Pr2_; 
        }; 
//-----------modified_end------------//
also for kappaf
Code:
        tmp<surfaceScalarField> nuf() const; 

//-----------modified_start------------// 
    //- Return the face-interpolated conductivity 
    tmp<surfaceScalarField> kappaf() const; 
//-----------modified_end------------//
7)
In myIncompressibleTwoPhaseMixture.C add the operations for the new parameters.
Code:
   rho2_("rho", dimDensity, nuModel2_->viscosityProperties().lookup("rho")),
//-----------modified_start------------//
    cp1_("cp", dimensionSet(0, 2, -2, -1, 0, 0, 0), nuModel1_->viscosityProperties().lookup("cp")),
    cp2_("cp", dimensionSet(0, 2, -2, -1, 0, 0, 0), nuModel2_->viscosityProperties().lookup("cp")),
    Pr1_("Pr", dimensionSet(0, 0, 0, 0, 0, 0, 0), nuModel1_->viscosityProperties().lookup("Pr")),
    Pr2_("Pr", dimensionSet(0, 0, 0, 0, 0, 0, 0), nuModel2_->viscosityProperties().lookup("Pr")),
//-----------modified_end------------//
and
Code:
            nuModel2_->viscosityProperties().lookup("rho") >> rho2_;
//-----------modified_start--------------------//
    nuModel1_->viscosityProperties().lookup("cp") >> cp1_;
    nuModel2_->viscosityProperties().lookup("cp") >> cp2_;
    nuModel1_->viscosityProperties().lookup("Pr") >> Pr1_;
    nuModel2_->viscosityProperties().lookup("Pr") >> Pr2_;
//-----------modified_end----------------------//
Also add the lines for the calculation of kappaf().
Code:
Foam::tmp<Foam::surfaceScalarField>
Foam::incompressibleTwoPhaseMixture::nuf() const
{
    const surfaceScalarField alpha1f
    (
        min(max(fvc::interpolate(alpha1_), scalar(0)), scalar(1))
    );

    return tmp<surfaceScalarField>
    (
        new surfaceScalarField
        (
            "nuf",
            (
                alpha1f*rho1_*fvc::interpolate(nuModel1_->nu())
              + (scalar(1) - alpha1f)*rho2_*fvc::interpolate(nuModel2_->nu())
            )/(alpha1f*rho1_ + (scalar(1) - alpha1f)*rho2_)
        )
    );
}
//-----------modified_start------------//
Foam::tmp<Foam::surfaceScalarField>
Foam::incompressibleTwoPhaseMixture::kappaf() const
{
    const surfaceScalarField alpha1f
    (
        min(max(fvc::interpolate(alpha1_), scalar(0)), scalar(1))
    );

    return tmp<surfaceScalarField>
    (
        new surfaceScalarField
        (
            "kappaf",
            (
                alpha1f*rho1_*cp1_*(1/Pr1_)
                *fvc::interpolate(nuModel1_->nu())
                + (scalar(1) - alpha1f)*rho2_*cp2_
                *(1/Pr2_)*fvc::interpolate(nuModel2_->nu())
            )
        )
    );
}
//-----------modified_end------------//
8)
Compile both libraries from the respective folder. Start with myIncompressibleTwoPhaseMixture, because myImmiscibleIncompressibleTwoPhaseMixture depends on it already being compiled beforehand.

cd incompressible
wclean
wmake libso
cd ..
cd myImmiscibleIncompressibleTwoPhaseMixture
wclean
wmake libso


Compiling works at this stage, which is good for the moment but doesn't necessarily mean to me that I did everything right.



B) Modification of the solver interFoam to interTempFoam


1)
Enter the destination of the new solver and copy the base solver.

cd $WM_PROJECT_USER_DIR/applications/solvers/multiphase
cp -rp $FOAM_APP/solvers/multiphase/interFoam .

2)
Rename the folder and the .C file.

mv interFoam interTempFoam
cd interTempFoam
mv interFoam.C interTempFoam.C

3)
Adapt the file Make/files to the changed naming and path.
Code:
interTempFoam.C 

EXE = $(FOAM_USER_APPBIN)/interTempFoam
4)
In interTempFoam.C adapt the name of the following library being included.
Code:
#include "myImmiscibleIncompressibleTwoPhaseMixture.H"
5)
Add the following lines in the file createFields.H.
Code:
 Info<< "Reading field U\n" << endl; 
    volVectorField U 
    ( 
        IOobject 
        ( 
            "U", 
            runTime.timeName(), 
            mesh, 
            IOobject::MUST_READ, 
            IOobject::AUTO_WRITE 
        ), 
        mesh 
    ); 

//-------------modified_start--------------// 
    Info<< "Reading field T\n" << endl; 
    volScalarField T 
    ( 
        IOobject 
        ( 
            "T", 
            runTime.timeName(), 
            mesh, 
            IOobject::MUST_READ, 
            IOobject::AUTO_WRITE 
        ), 
        mesh 
    ); 
//-------------modified_end--------------//
and
Code:
   const dimensionedScalar& rho2 = mixture.rho2(); 
//-------------modified_start--------------// 
    const dimensionedScalar& cp1 = mixture.cp1(); 
    const dimensionedScalar& cp2 = mixture.cp2(); //not for Pr1 und Pr2 ??? 
//-------------modified_end--------------//
and
Code:
  // Mass flux 
    surfaceScalarField rhoPhi 
    ( 
        IOobject 
        ( 
            "rhoPhi", 
            runTime.timeName(), 
            mesh, 
            IOobject::NO_READ, 
            IOobject::NO_WRITE 
        ), 
        fvc::interpolate(rho)*phi 
    ); 

//-------------modified_start--------------// 
    // Need to store rhoCp for ddt(rhoCp, T) 
    volScalarField rhoCp 
    ( 
        IOobject 
        ( 
            "rhoCp", 
            runTime.timeName(), 
            mesh, 
            IOobject::READ_IF_PRESENT 
        ), 
        alpha1*rho1*cp1 + alpha2*rho2*cp2, 
        alpha1.boundaryField().types() 
    ); 
    rhoCp.oldTime(); 

    // heat flux 
    surfaceScalarField rhoCpPhi 
    ( 
        IOobject 
        ( 
            "rhoCpPhi", 
            runTime.timeName(), 
            mesh, 
            IOobject::NO_READ, 
            IOobject::NO_WRITE 
        ), 
        fvc::interpolate(rhoCp)*phi 
    ); 
//-------------modified_end--------------//
6)
In alphaEqn.H add:
Code:
      // Calculate the end-of-time-step mass flux 
        rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2; 
//-------------modified_start--------------// 
        // Calculate the end-of-time-step heat flux 
    rhoCpPhi = phiAlpha*(rho1*cp1 - rho2*cp2) + phi*rho2*cp2; 
//-------------modified_end--------------//
and in alphaEqnSubCycle.H add:
Code:
rho == alpha1*rho1 + alpha2*rho2;
//-------------modified_start--------------//
rhoCp == alpha1*rho1*cp1 + alpha2*rho2*cp2;
//-------------modified_end--------------//
7)
Create a file named Teqn.H in the interTempFoam folder containing the Energy Equation:
Code:
surfaceScalarField kappaf = incompressibleTwoPhaseMixture.kappaf();

fvScalarMatrix TEqn
(
    fvm::ddt(rhoCp,T)
    + fvm::div(rhoCpPhi,T)
    - fvm::laplacian(kappaf,T)
);

TEqn.solve();
8)
Add the command for solving the E-Eqn in interTempFoam.C. The specific location of the added line may be object of discussion. Here is my suggestion:
Code:
        // --- Pressure-velocity PIMPLE corrector loop
        while (pimple.loop())
        {
            #include "alphaControls.H"
            #include "alphaEqnSubCycle.H"

            mixture.correct();

            #include "UEqn.H"

            // --- Pressure corrector loop
            while (pimple.correct())
            {
                #include "pEqn.H"
            }

            if (pimple.turbCorr())
            {
                turbulence->correct();
            }
        }

//--------------modified_start----------------//
        #include "TEqn.H"
//--------------modified_end------------------//
9)
Adapt the file Make/options to the names and locations of the beforehand modified libraries. The following code is probably not correct and thus object of my questions.
Code:
EXE_INC = \
    -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
    -I$(LIB_SRC)/transportModels \
    -I$(WM_PROJECT_USER_DIR)/src/transportModels/incompressible/lnInclude \
    -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
    -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
    -I$(WM_PROJECT_USER_DIR)/src/transportModels/myImmiscibleIncompressibleTwoPhaseMixture/lnInclude \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/fvOptions/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \
    -I$(LIB_SRC)/sampling/lnInclude

EXE_LIBS = \
    -L$(FOAM_USER_LIBBIN) \
    -lmyImmiscibleIncompressibleTwoPhaseMixture \
    -L$(FOAM_LIBBIN) \
    -lincompressibleTurbulenceModel \
    -lincompressibleRASModels \
    -lincompressibleLESModels \
    -lfiniteVolume \
    -lfvOptions \
    -lmeshTools \
    -lsampling
9)
Compile the solver from within its directory interTempFoam.

wclean
wmake

<------------------------------------------------------------------------------------------------------------------------->
When I do everything as described I get the following output log:
Code:
~/OpenFOAM/puhlig-2.4.0/applications/solvers/multiphase/interTempFoam$ wmake
Making dependency list for source file interTempFoam.C
SOURCE=interTempFoam.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam240/src/transportModels/twoPhaseMixture/lnInclude -I/opt/openfoam240/src/transportModels -I/home/puhlig/OpenFOAM/puhlig-2.4.0/src/transportModels/incompressible/lnInclude -I/opt/openfoam240/src/transportModels/interfaceProperties/lnInclude -I/opt/openfoam240/src/turbulenceModels/incompressible/turbulenceModel -I/home/puhlig/OpenFOAM/puhlig-2.4.0/src/transportModels/myImmiscibleIncompressibleTwoPhaseMixture/lnInclude -I/opt/openfoam240/src/finiteVolume/lnInclude -I/opt/openfoam240/src/fvOptions/lnInclude -I/opt/openfoam240/src/meshTools/lnInclude -I/opt/openfoam240/src/sampling/lnInclude -IlnInclude -I. -I/opt/openfoam240/src/OpenFOAM/lnInclude -I/opt/openfoam240/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/interTempFoam.o
In file included from interTempFoam.C:108:0:
TEqn.H: In function ‘int main(int, char**)’:
TEqn.H:1:58: error: expected primary-expression before ‘.’ token
 surfaceScalarField kappaf = incompressibleTwoPhaseMixture.kappaf();
                                                          ^
In file included from interTempFoam.C:64:0:
/opt/openfoam240/src/finiteVolume/lnInclude/readTimeControls.H:38:8: warning: unused variable ‘maxDeltaT’ [-Wunused-variable]
 scalar maxDeltaT =
        ^
make: *** [Make/linux64GccDPOpt/interTempFoam.o] Error 1
Let us prioritize the error over the warning.
Do you have any idea how it comes to that error and how to solve it?

I would very much appreciate comments from your side.

Best Regards
Perry

Hi Perry,

I know this is a really old post however i wonder if you managed to solve this problem as i have tried so many ways but i keep getting your error.


Kind regards

Rimsha
block is offline   Reply With Quote

Old   March 10, 2016, 04:39
Default
  #29
Pay
New Member
 
Perry Uhlig
Join Date: Oct 2015
Location: Germany
Posts: 13
Rep Power: 10
Pay is on a distinguished road
Hello Rimsha,

Disclaimer: I did all this in OF 2.4.0 and got unphysical results. Seems like Hannah did not in version 2.3.

Nevertheless, I did succesfully compile the solver and libraries. When I remember correctly the missing change was done in the TEqn.H file:
"surfaceScalarField kappaf = incompressibleTwoPhaseMixture.kappaf();"
was changed to
"surfaceScalarField kappaf = mixture.kappaf();"

I can't find my documentation with english commentary, but in spite of that the attached file should help you (there is also described how to setup a test case).

As closing remark: I went over to using compressibleInterFoam, which solves the energy equation.
Attached Files
File Type: docx interTempFoam.docx (32.9 KB, 177 views)
Pay is offline   Reply With Quote

Old   March 10, 2016, 07:25
Default
  #30
New Member
 
Rimsha
Join Date: Jan 2016
Posts: 25
Rep Power: 10
block is on a distinguished road
Quote:
Originally Posted by Pay View Post
Hello Rimsha,

Disclaimer: I did all this in OF 2.4.0 and got unphysical results. Seems like Hannah did not in version 2.3.

Nevertheless, I did succesfully compile the solver and libraries. When I remember correctly the missing change was done in the TEqn.H file:
"surfaceScalarField kappaf = incompressibleTwoPhaseMixture.kappaf();"
was changed to
"surfaceScalarField kappaf = mixture.kappaf();"

I can't find my documentation with english commentary, but in spite of that the attached file should help you (there is also described how to setup a test case).

As closing remark: I went over to using compressibleInterFoam, which solves the energy equation.
Hiya,

Thank you for your reply, I managed to complied the code yesterday, i am also getting strange results when the difference in cp is large in both fluids so i am looking into this right now.

Thank you very much for the document it is highly appreciated.

Kind Regards

Rimsha
block is offline   Reply With Quote

Old   April 17, 2016, 10:10
Default
  #31
New Member
 
Julia
Join Date: Jan 2016
Posts: 6
Rep Power: 10
Wangzhaoting is on a distinguished road
Hi,Hannah and Perry
I'm working on the similar object. I've used the wolfdynamics page to make the same modifications as you to incorporate temperature into OpenFOAM (3.0).The damBreak case works well and the temperature field is physically.When I try to simulate the object which is a simulation of slug flow temperature field about 2.6-meters long pipeline with radius of 0.013 meter.Temperature of air and water are both 313 K.And the temperature of tube wall is 277 K.But some of final value of temperature is much higher than anticipated results(which is physically impossible).Some values are physical. The damBreak works well,but the pipeline can't. I really don't know what the problem is. Please help!

Julia
Wangzhaoting is offline   Reply With Quote

Old   April 19, 2016, 05:45
Default
  #32
Pay
New Member
 
Perry Uhlig
Join Date: Oct 2015
Location: Germany
Posts: 13
Rep Power: 10
Pay is on a distinguished road
Hello Julia,
initially I don't know what the problem is, too.
I would recommend you to start a new thread and supply more detailed information in there, like: turbulence model?, boundary, starting conditions, zip-file of your case folder, maybe a picture of physically impossible temperature field.
Greetings
Perry
Pay is offline   Reply With Quote

Old   April 21, 2016, 09:47
Default
  #33
New Member
 
Julia
Join Date: Jan 2016
Posts: 6
Rep Power: 10
Wangzhaoting is on a distinguished road
Thank you for your reply,I will strat a new thread
Wangzhaoting is offline   Reply With Quote

Old   June 1, 2016, 05:30
Default working solver
  #34
New Member
 
Felix Kronowetter
Join Date: Apr 2016
Posts: 1
Rep Power: 0
thebear is on a distinguished road
hey,
i just worked through the solver and made some little lib and class changes and it works fine with OF2.3.1.
Attached Files
File Type: gz myImmiscibleIncompressibleTwoPhaseMixture.tar.gz (21.0 KB, 102 views)
thebear is offline   Reply With Quote

Old   June 13, 2016, 10:33
Default
  #35
New Member
 
Rimsha
Join Date: Jan 2016
Posts: 25
Rep Power: 10
block is on a distinguished road
Quote:
Originally Posted by thebear View Post
hey,
i just worked through the solver and made some little lib and class changes and it works fine with OF2.3.1.
Thanks so much for the replay, i found the error and corrected it, however thank you so much for the help.

Kind Regards

Rimsha
block is offline   Reply With Quote

Old   June 17, 2016, 12:36
Default
  #36
Member
 
shashank moghe
Join Date: Feb 2015
Posts: 32
Rep Power: 11
smog is on a distinguished road
Can you let us all know what the problem was and how you fixed it?
smog is offline   Reply With Quote

Old   June 19, 2016, 10:55
Default
  #37
New Member
 
Rimsha
Join Date: Jan 2016
Posts: 25
Rep Power: 10
block is on a distinguished road
Hi Smog,

sure thing,

there were a number of things that was wrong with my libraries,

1) 1.png

All the Foam:: incompresibleTwoPhaseMixture: : incompressibleTwoPhaseMixture needed to be changed to the picture attached above so to the name of the new library name i have selected.

2) error of Kaapaf in the Temp equation was also a concern which was solved using the suggestion by Perry above.

Apart from that i cant remember what else however if i do remember i will post back.

Kind Regards

Rimsha
block is offline   Reply With Quote

Old   June 15, 2017, 07:28
Default Help please!!!
  #38
New Member
 
Ehi
Join Date: Apr 2017
Posts: 4
Rep Power: 9
eee_099_OpenFOAM_4.1 is on a distinguished road
Hello Guys,
Can someone help me please, I need to model melting of a powder particle (solid to liquid, - MODELLING OF BLOWN-POWDER REPAIR PROCESS) and I have managed to modify, compile and use the new SOlver (Inter_Thermal_Foam) as done Perry, hannah and the attached PDFs (Thanks Perry), and it seems to work fine with the "damBreak" tutorial, but now need to adpot it to mine, but have no idea where to start. I was told that I would need to add the "SOURCE" term to the Energy euation TEqn.H, and a few other modifications to files.

I also came across this link, but have no idea what he (Fabian) did;
Solid/liquid phase change

Any help would be greatly appreciated.

You can also contact me via email if that helps.

Many thanks in advance.

Ehi
eee_099_OpenFOAM_4.1 is offline   Reply With Quote

Old   June 15, 2017, 07:34
Default Help please!!!
  #39
New Member
 
Ehi
Join Date: Apr 2017
Posts: 4
Rep Power: 9
eee_099_OpenFOAM_4.1 is on a distinguished road
Hello Guys,
Can someone help me please, I'm trying to model melting of a powder particle in space or unit volume (solid to liquid), and I have so far managed to modify, compile and use the new Solver (Inter_Thermal_Foam) as carried out and beautifully explained/detailed by Perry, Hannah and the attached PDFs (Thanks Perry!), and it seems to work fine with the "damBreak" tutorial, but now need to adopt it to mine, but have no idea where to start.
I was told that I would now need to add the "SOURCE" term t(from "STEFAN"'s condition) to the Energy equation TEqn.H, and a few other modifications to the appropriate files. HOW DO I DO THIS PLEASE?

I also came across this link, but have no idea what/how he (Fabian) did (it);
Solid/liquid phase change

Any help would be greatly appreciated.
eee_099_OpenFOAM_4.1 is offline   Reply With Quote

Old   June 23, 2017, 07:01
Default adding "SOURCE TERM" to the modified interFoam solver and Shared Library
  #40
New Member
 
Ehi
Join Date: Apr 2017
Posts: 4
Rep Power: 9
eee_099_OpenFOAM_4.1 is on a distinguished road
Hello guys,
I'm currently working on additive manufacturing (Blown Powder repair) for Aerospace Turbine components PhD, and successfully modified and ran a modified version of following the instructions.

But now I need to incorporate the "SOURCE TERM" as you've described on here; Solid/liquid phase change, my question is, HOW DO I GO ABOUT MODIFYING THE FILES PLEASE, and do I need to modify files in the src/transportModels/incompressible, below doing the same for the "SOLVER" folder?

I JUST NEED TO MODEL A SOLID MELTING, and will hopefully take it from there.
solve
(
hEqn ==
- hs*fvc::ddt(rho, gamma) //Source term from Stefan condition
);
Thanks in advance, and keep up the great work you guys have been doing.

Kind regards,
Ekoh E E
eee_099_OpenFOAM_4.1 is offline   Reply With Quote

Reply

Tags
2.4.0, compile problems, interfoam, teqn


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
Source Term due to evaporation in energy transport equation styleworker OpenFOAM Programming & Development 3 September 7, 2022 03:09
Adding Energy Equation for porousSimpleFoam yesaswi92 OpenFOAM Programming & Development 20 April 13, 2018 08:17
Definition of energy equation using UDF aestas Fluent UDF and Scheme Programming 15 April 28, 2015 03:33
help adding the energy equation to porousinterfoam using the enthalpy formulation nadine OpenFOAM Programming & Development 18 June 17, 2014 08:39
Why FVM for high-Re flows? Zhong Lei Main CFD Forum 23 May 14, 1999 13:22


All times are GMT -4. The time now is 00:56.