Skip to content

Commit

Permalink
Merged some changes from master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanlucf22 committed Mar 12, 2019
1 parent 9f161b0 commit 2b55138
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 9 deletions.
2 changes: 1 addition & 1 deletion source/BeckermannCompositionRHSStrategy.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
// POSSIBILITY OF SUCH DAMAGE.
//
#ifndef included_BeckermannCompositionRHSStrategy
#define included_BeckermannCompositionRHSStrategy
#define included_BeckermannCompositionRHSStrategy

#include "CompositionRHSStrategy.h"

Expand Down
3 changes: 2 additions & 1 deletion source/QuatModel.C
Original file line number Diff line number Diff line change
Expand Up @@ -2772,7 +2772,8 @@ void QuatModel::preRunDiagnostics( void )
if( found_ceq && !d_is_from_restart)
{
setRefPhaseConcentrationsToEquilibrium(ceq);
setPhaseConcentrationsToEquilibrium(ceq);
if( d_model_parameters.initPhaseConcAtEq() )
setPhaseConcentrationsToEquilibrium(ceq);
}

} // with_concentration
Expand Down
3 changes: 3 additions & 0 deletions source/QuatModelParameters.C
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ void QuatModelParameters::readConcDB(boost::shared_ptr<tbox::Database> conc_db)
d_initc_in_phase.resize(nterms);
conc_db->getDoubleArray("initc_in_phase",&d_initc_in_phase[0],nterms);
}

d_init_phase_conc_eq =
conc_db->getBoolWithDefault("init_phase_conc_eq", true);
}

//=======================================================================
Expand Down
9 changes: 8 additions & 1 deletion source/QuatModelParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,12 @@ class QuatModelParameters
{
return d_epsilon_phase/sqrt(32.*d_phase_well_scale);
}


bool initPhaseConcAtEq()const
{
return d_init_phase_conc_eq;
}

private:
void readNumberSpecies(boost::shared_ptr<tbox::Database> conc_db);

Expand Down Expand Up @@ -509,6 +514,8 @@ class QuatModelParameters
bool d_visit_energy_output;
bool d_visit_grain_output;

bool d_init_phase_conc_eq;

void readMolarVolumes(boost::shared_ptr<tbox::Database> db);
};

Expand Down
55 changes: 49 additions & 6 deletions source/fortran/functions.m4
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,19 @@ c Valid values for type are "quadratic" and "pbg"
phit = min( 1.d0, phit )
interp_func = phit

else if ( type(1:1) .eq. 'a' ) then

if( phi < 0.08333333333333333d0 )then
phit = max( 0.d0, phi )
interp_func = 54.d0*phit*phit*phit
else if( phi>0.9166666666666666d0 )then
phit = min( 1.d0, phi )
phit = 1.d0-phit
interp_func = 1.d0-54.d0*phit*phit*phit
else
interp_func = 1.125*phi-0.0625
endif

else if ( type(1:1) .eq. '3' ) then

phit = max( 0.d0, phi )
Expand Down Expand Up @@ -173,6 +186,19 @@ c-----------------------------------------------------------------------
deriv_interp_func = 0.d0
endif

else if ( type(1:1) .eq. 'a' ) then

if( phi < 0.08333333333333333d0 )then
phit = max( 0.d0, phi )
deriv_interp_func = 162.d0*phit*phit
else if( phi>0.9166666666666666d0 )then
phit = min( 1.d0, phi )
phit = 1.d0-phit
deriv_interp_func = 162.d0*phit*phit
else
deriv_interp_func = 1.125
endif

else if ( type(1:1) .eq. '3' ) then

phit = max( 0.d0, phi )
Expand Down Expand Up @@ -236,6 +262,19 @@ c=======================================================================

second_deriv_interp_func = 0.d0

else if ( type(1:1) .eq. 'a' ) then

if( phi < 0.08333333333333333d0 )then
phit = max( 0.d0, phi )
second_deriv_interp_func = 324.d0*phit
else if( phi>0.9166666666666666d0 )then
phit = min( 1.d0, phi )
phit = 1.d0-phit
second_deriv_interp_func = -324.d0*phit
else
second_deriv_interp_func = 0.d0
endif

else if ( type(1:1) .eq. 'c' ) then

second_deriv_interp_func = 0.d0
Expand Down Expand Up @@ -538,13 +577,13 @@ c-----------------------------------------------------------------------
double precision phi, phit
character*(*) type1, type2

if ( type1(1:1) .eq. 'p' )then
if ( type1(1:1) .eq. type2(1:1) )then

if ( type2(1:1) .eq. 'p' )then
interp_ratio = 1.d0

interp_ratio = 1.d0
else if ( type1(1:1) .eq. 'p' )then

else if ( type2(1:1) .eq. 'l' )then
if ( type2(1:1) .eq. 'l' )then

phit = max( 0.d0, min( 1.d0, phi ) )

Expand Down Expand Up @@ -577,7 +616,11 @@ c-----------------------------------------------------------------------
double precision phi, phit
character*(*) type1, type2

if ( type1(1:1) .eq. 'p' )then
if ( type1(1:1) .eq. type2(1:1) )then

compl_interp_ratio = 1.d0

else if ( type1(1:1) .eq. 'p' )then

if ( type2(1:1) .eq. 'p' )then

Expand All @@ -592,7 +635,7 @@ c-----------------------------------------------------------------------

else

print *, "Error, interp_ratio: unknown/incompatible types"
print *, "Error, compl_interp_ratio: unknown/incomp. types"
stop

endif
Expand Down

0 comments on commit 2b55138

Please sign in to comment.