Download MOOSE Workshop - MOOSE Framework
Transcript
Convection.h / .C
#ifndef CONVECTION_H
#define CONVECTION_H
#include "Convection.h"
#include "Kernel.h"
class Convection;
template<>
InputParameters validParams<Convection>();
class Convection : public Kernel
{
public:
Convection(const std::string & name,
InputParameters parameters);
protected:
virtual Real computeQpResidual();
virtual Real computeQpJacobian();
private:
VariableGradient &
};
grad some variable;
template<>
InputParameters validParams<Convection>()
{
InputParameters params = validParams<Kernel>();
params.addRequiredCoupledVar("some variable", "Doc");
return params;
}
Convection::Convection(const std::string & name,
InputParameters parameters):
Kernel(name, parameters),
_grad_some_variable(coupledGradient("some variable"))
{}
Real Convection::computeQpResidual()
{
return _test[_i][_qp]*( grad some variable[ qp]*_grad_u[_qp]);
}
Real Convection::computeQpJacobian()
{
return _test[_i][_qp]*( grad some variable[ qp]*_grad_phi[_j][_qp]);
}
#endif //CONVECTION_H
93 / 313