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

Cleaned up BCs #98

Merged
merged 1 commit into from
Sep 20, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion include/base/PikaApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ class PikaApp;
template<>
InputParameters validParams<PikaApp>();

/**
* The main application for the Pika phase-field model
*/
class PikaApp : public MooseApp
{
public:
PikaApp(const std::string & name, InputParameters parameters);
virtual ~PikaApp();

static void registerApps();
static void registerObjects(Factory & factory);
static void associateSyntax(Syntax & syntax, ActionFactory & action_factory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
/* With the U. S. Department of Energy */
/**********************************************************************************/

#ifndef CHEMICALPOTENTIALBC_H
#define CHEMICALPOTENTIALBC_H
#ifndef PIKACHEMICALPOTENTIALBC_H
#define PIKACHEMICALPOTENTIALBC_H

// MOOSE includes
#include "NodalBC.h"
Expand All @@ -19,33 +19,37 @@
#include "PropertyUserObjectInterface.h"

//Forward Declarations
class ChemicalPotentialBC;
class PikaChemicalPotentialBC;

template<>
InputParameters validParams<ChemicalPotentialBC>();
InputParameters validParams<PikaChemicalPotentialBC>();

class ChemicalPotentialBC :
/**
* Chemical potential equilibrium boundary condition
* u - u_eq (1 - phi)/2
*/
class PikaChemicalPotentialBC :
public NodalBC,
public PropertyUserObjectInterface
{
public:
ChemicalPotentialBC(const std::string & name, InputParameters parameters);

virtual ~ChemicalPotentialBC(){};
PikaChemicalPotentialBC(const std::string & name, InputParameters parameters);
virtual ~PikaChemicalPotentialBC(){};

protected:

/**
* The value of the variable at a point.
*
* This must be overridden by derived classes.
* Computes the chemical potential boundary condition
*/
virtual Real computeQpResidual();

private:

/// Coupled temperature variable
VariableValue & _temperature;

/// Coupled phase-field variable
VariableValue & _phase;
};

#endif // CHEMICALPOTENTIALBC_H
#endif // PIKACHEMICALPOTENTIALBC_H
5 changes: 3 additions & 2 deletions src/base/PikaApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/* With the U. S. Department of Energy */
/**********************************************************************************/

// Main application
#include "PikaApp.h"
#include "Moose.h"
#include "AppFactory.h"
Expand Down Expand Up @@ -66,7 +67,7 @@
#include "PikaCriteriaAction.h"

//BCS
#include "ChemicalPotentialBC.h"
#include "PikaChemicalPotentialBC.h"

template<>
InputParameters validParams<PikaApp>()
Expand Down Expand Up @@ -147,7 +148,7 @@ PikaApp::registerObjects(Factory & factory)

// BoundaryConditions
registerBoundaryCondition(IbexSurfaceFluxBC);
registerBoundaryCondition(ChemicalPotentialBC);
registerBoundaryCondition(PikaChemicalPotentialBC);
}

void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
/* With the U. S. Department of Energy */
/**********************************************************************************/

#include "ChemicalPotentialBC.h"
#include "PikaChemicalPotentialBC.h"
#include "PropertyUserObject.h"
template<>
InputParameters validParams<ChemicalPotentialBC>()
InputParameters validParams<PikaChemicalPotentialBC>()
{
InputParameters params = validParams<NodalBC>();
params += validParams<PropertyUserObjectInterface>();
Expand All @@ -21,7 +21,7 @@ InputParameters validParams<ChemicalPotentialBC>()
return params;
}

ChemicalPotentialBC::ChemicalPotentialBC(const std::string & name, InputParameters parameters) :
PikaChemicalPotentialBC::PikaChemicalPotentialBC(const std::string & name, InputParameters parameters) :
NodalBC(name, parameters),
PropertyUserObjectInterface(name, parameters),
_temperature(coupledValue("temperature")),
Expand All @@ -30,7 +30,7 @@ ChemicalPotentialBC::ChemicalPotentialBC(const std::string & name, InputParamete
}

Real
ChemicalPotentialBC::computeQpResidual()
PikaChemicalPotentialBC::computeQpResidual()
{
return _u[_qp] - _property_uo.equilibriumChemicalPotential(_temperature[_qp]) * ((1.0 - _phase[_qp]) / 2.0);
}