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

Introduce a drag model

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   February 27, 2012, 01:15
Default Introduce a drag model
  #1
Member
 
Jeong Kim
Join Date: Feb 2010
Posts: 41
Rep Power: 7
enoch is on a distinguished road
I wanted to introduce a drag model call "Tam" into the twoPhaseEulerFoam solver in OF v1.7.1. However, the solver made a complain. I added Tam.C to "files" located at the following folder. Please let me know what mistakes I did in Tam.C.

"run/multiphase/twoPhaseEulerFoamMod/interfacialModels/Make/"

====Tam.C========
...

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

Foam::tmp<Foam::volScalarField> Foam::Tam::K
(
const volScalarField& Ur
) const
{
volScalarField beta = max(scalar(1) - alpha_, scalar(1.0e-6));

forAll(alpha_, celli)
{
if(alpha_[celli] > 0.6666)
{
functAlpha[celli] = 1.0e6;
}
}

return 4.5/(beta*alpha_ + scalar(1.0e-6))*phaseb_.nu()/pow(phasea_.d(),2.0)*functAlpha;


}

================

Below is what I see on my screen.

=====
....

Time = 0.002

DILUPBiCG: Solving for alpha, Initial residual = 0.0021426, Final residual = 5.45235e-12, No Iterations 3
Dispersed phase volume fraction = 0.36753 Min(alpha) = -0.0272179 Max(alpha) = 1.00084
DILUPBiCG: Solving for alpha, Initial residual = 8.90552e-05, Final residual = 1.62296e-12, No Iterations 3
Dispersed phase volume fraction = 0.36753 Min(alpha) = -0.0291739 Max(alpha) = 1.00075
#0 Foam::error:rintStack(Foam::Ostream&) in "/home/jeong/OpenFOAM/openfoam171/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::sigFpe::sigFpeHandler(int) in "/home/jeong/OpenFOAM/openfoam171/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Uninterpreted:
#3 Foam::sqrt(Foam::Field<double>&, Foam::UList<double> const&) in "/home/jeong/OpenFOAM/openfoam171/lib/linuxGccDPOpt/libOpenFOAM.so"
#4 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::sqrt<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<doub le, Foam::fvPatchField, Foam::volMesh> > const&) in "/home/jeong/OpenFOAM/openfoam171/lib/linuxGccDPOpt/libEulerianInterfacialModels.so"
#5 Foam::Tam::K(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) const in "/home/jeong/OpenFOAM/openfoam171/lib/linuxGccDPOpt/libEulerianInterfacialModels.so"
#6
in "/home/jeong/OpenFOAM/openfoam171/applications/bin/linuxGccDPOpt/twoPhaseEulerFoamMod"
#7 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#8
in "/home/jeong/OpenFOAM/openfoam171/applications/bin/linuxGccDPOpt/twoPhaseEulerFoamMod"
Floating point exception

=====
enoch is offline   Reply With Quote

Old   February 29, 2012, 10:46
Default
  #2
Member
 
Laurens Van Dyck
Join Date: Jul 2011
Location: Netherlands/Germany
Posts: 34
Rep Power: 6
laurensvd is on a distinguished road
There is somewhere an error in calculating a square root. I suppose the value of K becomes negative in your calculation. Double check your formula or consider bounding the value of K: max(SMALL,4.5/...)

Edit: You can see that your minimum volume fraction is negative (Min(alpha) = -0.0272179), This is not physical but if it works with everything else I would replace all 'alpha' in your code with 'alphaBounded' and add above:

volScalarField alphaBounded = min(1.0,max(0.0,alpha));
laurensvd is offline   Reply With Quote

Old   February 29, 2012, 21:19
Default
  #3
Member
 
Jeong Kim
Join Date: Feb 2010
Posts: 41
Rep Power: 7
enoch is on a distinguished road
Thank you for your comment.
enoch is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
about Subgrid-scale model impecca OpenFOAM Running, Solving & CFD 4 December 20, 2013 11:36
drag calculation of a car model by phoenics mukut Phoenics 2 January 9, 2010 19:07
multiphase model and drag law Yasmail AKARIOUH FLUENT 0 April 29, 2008 07:44
multiphase flow modelling, Drag model Anant CFX 1 February 4, 2008 05:18
Laminar wing profiles and drag gregorv OpenFOAM Running, Solving & CFD 4 December 4, 2007 14:25


All times are GMT -4. The time now is 23:25.