Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Made the outputs for pika warning about incorrect interface choices …
Browse files Browse the repository at this point in the history
…(refer to pg 8 of Kaempfer 2009)
  • Loading branch information
micahjohnson150 committed Jul 1, 2014
1 parent 8fcc0ad commit 8d811c9
Show file tree
Hide file tree
Showing 8 changed files with 210 additions and 7 deletions.
5 changes: 5 additions & 0 deletions include/materials/PhaseFieldProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ class PhaseFieldProperties :
MaterialProperty<Real> & _specific_humidity_ratio;

const Real & _xi;

const Real & _d_o;

const Real & _interface_kinetic_coefficient;

};

#endif // PHASEFIELDPROPERTIES_H
77 changes: 77 additions & 0 deletions include/outputs/PikaDebug.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/****************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* (c) 2010 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See COPYRIGHT for full restrictions */
/****************************************************************/

#ifndef PIKADEBUG_H
#define PIKADEBUG_H

// MOOSE includes
#include "PetscOutput.h"
#include "FormattedTable.h"
#include "PropertyUserObjectInterface.h"
#include "PhaseFieldProperties.h"
class PikaDebug;

template<>
InputParameters validParams<PikaDebug>();

/**
* Base class for scalar variables and postprocessors output objects
*
* This class populates three FormattedTable objects that may then be used
* by child classes for creating custom output objects:
* _all_data_table - includes the data from both postprocessors and scalar aux variables
* _postprocessor_table - includes the data from only the postprocessors
* _scalar_table - includes the data from only the scalar aux variables
*
* @see CSV Console
*/
class PikaDebug :
public
PetscOutput,
PropertyUserObjectInterface,
MaterialPropertyInterface
{
public:

/**
* Class constructor.
*/
PikaDebug(const std::string & name, InputParameters);

/**
* Destructor
*/
virtual ~PikaDebug();

protected:

//@{
/**
* Produces an error, it is not possible to output nodal and elemental data to a table
*
* The call to this function is disable by suppressing the input parameter: output_nodal_variables
*/
virtual void outputNodalVariables();
virtual void outputElementalVariables();
virtual void outputScalarVariables();
virtual void outputPostprocessors();
virtual void outputVectorPostprocessors();
virtual std::string filename();
//@}
virtual void output();
const Real & _d_o;
const Real & _beta;
};

#endif /* TABLEOUTPUT_H */
7 changes: 7 additions & 0 deletions src/base/PikaApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
// Actions
#include "PikaMaterialAction.h"

//Outputs
#include "PikaDebug.h"


template<>
InputParameters validParams<PikaApp>()
{
Expand Down Expand Up @@ -105,6 +109,9 @@ PikaApp::registerObjects(Factory & factory)

// AuxKernels
registerAux(ErrorFunctionAux);

//outputs
registerOutput(PikaDebug);
}

void
Expand Down
6 changes: 3 additions & 3 deletions src/ics/ChemicalPotentialIC.C
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ ChemicalPotentialIC::ChemicalPotentialIC(const std::string & name, InputParamete
Real
ChemicalPotentialIC::value(const Point & /*p*/)
{
if (_phase[_qp]<1)
return _property_uo.equilibriumConcentration(_temperature[_qp]);
//return _property_uo.equilibriumConcentration(_temperature[_qp])*(1-_phase[_qp])*(1-_phase[_qp]);
if (_phase[_qp]<1.0)
return _property_uo.equilibriumConcentration(_temperature[_qp])*(1-_phase[_qp])*(1-_phase[_qp]);
//return _property_uo.equilibriumConcentration(_temperature[_qp]);
else
return 0;
}
2 changes: 1 addition & 1 deletion src/kernels/PhaseTransition.C
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ PhaseTransition::computeDFDOP(PFFunctionType type)

case Jacobian:
return 4.0 * _lambda[_qp] * _u[_qp] * (-_u[_qp]*_u[_qp]+1.0) * (_s[_qp] - (_s_eq[_qp])/(_property_uo.temporalScale()));
//return 4.0 * _lambda[_qp] * _u[_qp] * (-_u[_qp]*_u[_qp]+1.0) * (_s[_qp] - (_s_eq[_qp]));
// return 4.0 * _lambda[_qp] * _u[_qp] * (-_u[_qp]*_u[_qp]+1.0) * (_s[_qp] - (_s_eq[_qp]));
}
}
9 changes: 6 additions & 3 deletions src/materials/PhaseFieldProperties.C
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ PhaseFieldProperties::PhaseFieldProperties(const std::string & name, InputParame
_equilibrium_concentration(declareProperty<Real>("equilibrium_concentration")),
_saturation_pressure_of_water_vapor_over_ice(declareProperty<Real>("saturation_pressure_of_water_vapor_over_ice")),
_specific_humidity_ratio(declareProperty<Real>("specific_humidity_ratio")),
_xi(_property_uo.temporalScale())
_xi(_property_uo.temporalScale()),
_d_o(_property_uo.getParam<Real>("capillary_length")),
_interface_kinetic_coefficient(_property_uo.getParam<Real>("interface_kinetic_coefficient"))

{
}

Expand Down Expand Up @@ -62,12 +65,12 @@ PhaseFieldProperties::computeQpProperties()
_interface_velocity[_qp] = 1e-9; // [m/s]

//_capillary_length[_qp] =(rho_vs/rho_i[_qp])*(gamma * std::pow(a, 3.) ) / (k * _property_uo.referenceTemp());
_capillary_length[_qp] =(1.3e-9)/_xi;
_capillary_length[_qp] =_d_o/_xi;
// _capillary_length[_qp] =(1.3e-9);
// std::cout<<"d_o = " <<_capillary_length[_qp]<<std::endl;

//_beta[_qp] = (1./alpha) * (rho_i[_qp]/rho_vs)* std::sqrt((2.*libMesh::pi*m) / (k * _property_uo.referenceTemp()));
_beta[_qp] = (5.5e5)/_xi;
_beta[_qp]=_interface_kinetic_coefficient/_xi;
//_beta[_qp] = (5.5e5);
//std::cout<<"beta = "<<_beta[_qp]<<std::endl;

Expand Down
109 changes: 109 additions & 0 deletions src/outputs/PikaDebug.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/****************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* (c) 2010 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See COPYRIGHT for full restrictions */
/****************************************************************/

// MOOSE includes
#include "PikaDebug.h"
#include "FEProblem.h"
#include "Postprocessor.h"
#include "PetscSupport.h"
#include "Executioner.h"
#include "MooseApp.h"
#include "Conversion.h"

// libMesh includes
#include "libmesh/string_to_enum.h"

template<>
InputParameters validParams<PikaDebug>()
{
// Fit mode selection Enum
MooseEnum pps_fit_mode(FormattedTable::getWidthModes());

// Base class parameters
InputParameters params = validParams<PetscOutput>();
params.addParam<unsigned int>("_tid",0,"HACKED thread ID, fix later!");
// Suppressing the output of nodal and elemental variables disables this type of output
params.suppressParameter<bool>("output_elemental_variables");
params.suppressParameter<bool>("output_nodal_variables");
params.suppressParameter<bool>("elemental_as_nodal");
params.suppressParameter<bool>("scalar_as_nodal");
params.suppressParameter<bool>("output_input");
params.suppressParameter<bool>("output_postprocessors");
params.suppressParameter<bool>("output_vector_postprocessors");
params.suppressParameter<bool>("file_base");

return params;
}

PikaDebug::PikaDebug(const std::string & name, InputParameters parameters) :
PetscOutput(name, parameters),
PropertyUserObjectInterface(name, parameters),
MaterialPropertyInterface(name,parameters),
_d_o(_property_uo.getParam<Real>("capillary_length")),
_beta(_property_uo.getParam<Real>("interface_kinetic_coefficient"))

{
}

PikaDebug::~PikaDebug()
{
}

void
PikaDebug::outputNodalVariables()
{
mooseError("Nodal nonlinear variable output not supported by PikaDebug output class");
}

void
PikaDebug::outputElementalVariables()
{
mooseError("Elemental nonlinear variable output not supported by PikaDebug output class");
}

void
PikaDebug::outputPostprocessors()
{
//MOOSE Error
}

void
PikaDebug::outputVectorPostprocessors()
{
//Moose Error
}

void
PikaDebug::outputScalarVariables()
{
//Moose Error
}

std::string PikaDebug::filename()
{
//Moose Error
return std::string();
}

void
PikaDebug::output()
{
_console << "Moose Test in pika" << std::endl;
_console<< "Temporal Scale Value = "<< _property_uo.temporalScale()<<std::endl;
_console<< "Interface Thickness = "<< _property_uo._W<<std::endl;
_console<< "Capillary Length (d_o) = "<< _d_o<<std::endl;
_console<< "Interface Kinetic Coefficient (beta) = "<< _beta<<std::endl;
}


2 changes: 2 additions & 0 deletions src/userobjects/PropertyUserObject.C
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ PropertyUserObject::objectParams()
params.addParam<Real>("latent_heat", 2.6e9, "Latent heat of sublimation, L_{sg} [J/m^3]");
params.addParam<Real>("mobility", 1.0, "Phase-field mobility value");
params.addParam<Real>("temporal_scaling", 1.0, "Snow metamorphosis time scaling value");
params.addParam<Real>("capillary_length", 1.3e-9 , "Capillary Length (d_o) ");
params.addParam<Real>("interface_kinetic_coefficient", 5.5e5, "Interface kinetic coefficient (beta)");

// @todo{Group the above}
params.addParamNamesToGroup("atmospheric_pressure", "General");
Expand Down

0 comments on commit 8d811c9

Please sign in to comment.