Commit 1a3f6583 authored by Ron Rahaman's avatar Ron Rahaman

Merge branch 'develop' of xgitlab.cels.anl.gov:nek5000/moon into develop

parents 75c26a1f d71d23a3
#
# Testing a solution that is second order in space and first order in time
#
[Mesh]
# This is a cylinder with r=0.5, z=(0,1)
file = 3D_sideset.exo
block_id = '1'
block_name = 'interior'
boundary_id = '100 200 300'
boundary_name = 'top bottom wall'
[]
[Variables]
[./temp]
[../]
[]
[AuxVariables]
[./heat_flux_scalar_f_0_l]
family = SCALAR
order = FIFTH
[../]
[./heat_flux_scalar_f_1_l]
family = SCALAR
order = FIFTH
[../]
[./temp_bc_scalar_f_0_l]
family = SCALAR
order = FIFTH
[../]
[./temp_bc_scalar_f_1_l]
family = SCALAR
order = FIFTH
[../]
[]
[ICs]
[./v_ic]
type = ScalarComponentIC
variable = 'temp_bc_scalar_f_0_l'
values = '1.0 0.0 0.0 0.0 0.0'
[../]
[./temp_ic]
type = FunctionIC
variable = temp
function = '0.0'
[../]
[]
[Kernels]
[./HeatSource]
type = HeatSource
function = '1.0'
variable = temp
[../]
[./HeatDiff]
type = HeatConduction
variable = temp
[../]
[./HeatTdot]
type = HeatConductionTimeDerivative
variable = temp
[../]
[]
[Functions]
# BCFunction just returns 0.0 right now
[./bc_func]
type = ConstantFunction
[../]
[./legendre_function]
type = LegendrePolynomial
l_geom_norm = '0.0 1.0'
[../]
[./fourier_function]
type = FourierPolynomial
[../]
[./fl_reconstruction]
type = FourierLegendreReconstruction
l_order = 5
f_order = 2
l_direction = 2
legendre_function_name = 'legendre_function'
fourier_function_name = 'fourier_function'
poly_scalars = 'temp_bc_scalar_f_0_l temp_bc_scalar_f_1_l'
[../]
[]
[BCs]
[./top]
type = FunctionDirichletBC
variable = temp
boundary = 'top'
function = bc_func
[../]
[./bottom]
type = FunctionDirichletBC
variable = temp
boundary = 'bottom'
function = bc_func
[../]
[./wall]
type = FunctionDirichletBC
variable = temp
boundary = 'wall'
function = fl_reconstruction
[../]
#[./wall]
# type = FunctionDirichletBC
# variable = temp
# boundary = 'wall'
# function = bc_func
#[../]
[]
[Materials]
[./k]
type = GenericConstantMaterial
prop_names = 'thermal_conductivity'
prop_values = '1'
block = 'interior'
[../]
[./cp]
type = GenericConstantMaterial
prop_names = 'specific_heat'
prop_values = '1'
block = 'interior'
[../]
[./rho]
type = GenericConstantMaterial
prop_names = 'density'
prop_values = '1'
block = 'interior'
[../]
[]
[UserObjects]
# Legendre functions with Fourier order 0
[./nek_f_0_l_0]
type = NekSideIntegralVariableUserObject
variable = temp
boundary = wall
legendre_function_name = 'legendre_function'
fourier_function_name = 'fourier_function'
l_direction = 2
l_order = 0
f_order = 0
aux_scalar_name = heat_flux_scalar_f_0_l
diffusion_coefficient_name = 'thermal_conductivity'
surface_area_pp = 'surf_area'
[../]
[./nek_f_0_l_1]
type = NekSideIntegralVariableUserObject
variable = temp
boundary = wall
legendre_function_name = 'legendre_function'
fourier_function_name = 'fourier_function'
l_direction = 2
l_order = 1
f_order = 0
aux_scalar_name = heat_flux_scalar_f_0_l
diffusion_coefficient_name = 'thermal_conductivity'
surface_area_pp = 'surf_area'
[../]
[./nek_f_0_l_2]
type = NekSideIntegralVariableUserObject
variable = temp
boundary = wall
legendre_function_name = 'legendre_function'
fourier_function_name = 'fourier_function'
l_direction = 2
l_order = 2
f_order = 0
aux_scalar_name = heat_flux_scalar_f_0_l
diffusion_coefficient_name = 'thermal_conductivity'
surface_area_pp = 'surf_area'
[../]
[./nek_f_0_l_3]
type = NekSideIntegralVariableUserObject
variable = temp
boundary = wall
legendre_function_name = 'legendre_function'
fourier_function_name = 'fourier_function'
l_direction = 2
l_order = 3
f_order = 0
aux_scalar_name = heat_flux_scalar_f_0_l
diffusion_coefficient_name = 'thermal_conductivity'
surface_area_pp = 'surf_area'
[../]
[./nek_f_0_l_4]
type = NekSideIntegralVariableUserObject
variable = temp
boundary = wall
legendre_function_name = 'legendre_function'
fourier_function_name = 'fourier_function'
l_direction = 2
l_order = 4
f_order = 0
aux_scalar_name = heat_flux_scalar_f_0_l
diffusion_coefficient_name = 'thermal_conductivity'
surface_area_pp = 'surf_area'
[../]
# Legendre functions with Fourier order 1
[./nek_f_1_l_0]
type = NekSideIntegralVariableUserObject
variable = temp
boundary = wall
legendre_function_name = 'legendre_function'
fourier_function_name = 'fourier_function'
l_direction = 2
l_order = 0
f_order = 1
aux_scalar_name = heat_flux_scalar_f_1_l
diffusion_coefficient_name = 'thermal_conductivity'
surface_area_pp = 'surf_area'
[../]
[./nek_f_1_l_1]
type = NekSideIntegralVariableUserObject
variable = temp
boundary = wall
legendre_function_name = 'legendre_function'
fourier_function_name = 'fourier_function'
l_direction = 2
l_order = 1
f_order = 1
aux_scalar_name = heat_flux_scalar_f_1_l
diffusion_coefficient_name = 'thermal_conductivity'
surface_area_pp = 'surf_area'
[../]
[./nek_f_1_l_2]
type = NekSideIntegralVariableUserObject
variable = temp
boundary = wall
legendre_function_name = 'legendre_function'
fourier_function_name = 'fourier_function'
l_direction = 2
l_order = 2
f_order = 1
aux_scalar_name = heat_flux_scalar_f_1_l
diffusion_coefficient_name = 'thermal_conductivity'
surface_area_pp = 'surf_area'
[../]
[./nek_f_1_l_3]
type = NekSideIntegralVariableUserObject
variable = temp
boundary = wall
legendre_function_name = 'legendre_function'
fourier_function_name = 'fourier_function'
l_direction = 2
l_order = 3
f_order = 1
aux_scalar_name = heat_flux_scalar_f_1_l
diffusion_coefficient_name = 'thermal_conductivity'
surface_area_pp = 'surf_area'
[../]
[./nek_f_1_l_4]
type = NekSideIntegralVariableUserObject
variable = temp
boundary = wall
legendre_function_name = 'legendre_function'
fourier_function_name = 'fourier_function'
l_direction = 2
l_order = 4
f_order = 1
aux_scalar_name = heat_flux_scalar_f_1_l
diffusion_coefficient_name = 'thermal_conductivity'
surface_area_pp = 'surf_area'
[../]
[]
[Postprocessors]
[./surf_area]
type = AreaPostprocessor
boundary = wall
execute_on = timestep_begin
[../]
[]
[Executioner]
type = Transient
scheme = 'Explicit-Euler' # Others available: backward Euler, Crank-Nicholson, etc.
dt = 0.001 # Initial timestep size
start_time = 0 # Starting time
num_steps = 20 # DIVERGES AFTER 4 TIMESTEPS
nl_rel_tol = 1e-8 # Nonlinear relative tolerance
l_tol = 1e-6 # Linear tolerance
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
print_perf_log = true
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./aux]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
# Preconditioned JFNK (default)
type = Transient
num_steps = 20
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
# picard_max_its = 30
nl_abs_tol = 1e-14
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./sub]
type = TransientMultiApp
app_type = MoonApp
sub_cycling = true
positions = '0 0 0'
input_files = picard_sub_subcycling.i
[../]
[]
[Transfers]
[./u_to_sub]
type = MultiAppNearestNodeTransfer
direction = to_multiapp
multi_app = sub
source_variable = u
variable = aux
[../]
[./u_from_sub]
type = MultiAppNearestNodeTransfer
direction = from_multiapp
multi_app = sub
source_variable = u
variable = aux
[../]
[]
# Minimal Nek-wrapped MOOSE application.
# MOOSE Requires a mesh and a variable even
# if they are not used.
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./aux]
[../]
[]
[Executioner]
type = NekExecutioner
num_steps = 20
[./TimeStepper]
type = NekTimeStepper
dt = 0.01
[../]
[]
[Problem]
kernel_coverage_check = false
solve = false
[]
/****************************************************************/
/* 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 COUPLEDGRADAUX_H
#define COUPLEDGRADAUX_H
#include "AuxKernel.h"
//Forward Declarations
class CoupledGradAux;
template<>
InputParameters validParams<CoupledGradAux>();
/**
* Coupled auxiliary gradient
*/
class CoupledGradAux : public AuxKernel
{
public:
/**
* Factory constructor, takes parameters so that all derived classes can be built using the same
* constructor.
*/
CoupledGradAux(const InputParameters & parameters);
virtual ~CoupledGradAux();
protected:
virtual Real computeValue();
/// Gradient being set by this kernel
RealGradient _grad;
/// The number of coupled variable
int _coupled;
/// The value of coupled gradient
const VariableGradient & _coupled_grad;
/// Thermal conductivity (diffusion coefficient)
const MaterialProperty<Real> & _diffusion_coefficient;
};
#endif //COUPLEDGRADAUX_H
/****************************************************************/
/* 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 FOURIERLEGENDRERECONSTRUCTION_H
#define FOURIERLEGENDRERECONSTRUCTION_H
#include "Function.h"
#include "math.h"
#include "FourierPolynomial.h"
#include "LegendrePolynomial.h"
class FourierLegendreReconstruction : public Function
{
public:
FourierLegendreReconstruction(const InputParameters & parameters);
virtual ~FourierLegendreReconstruction();
virtual Real value(Real t, const Point & p);
protected:
/// Debug flag to print debug output
bool _dbg;
/// The coordinate directions of the integration for Legendre polynomial
int _l_direction;
/// The coordinate directions of the itnegration for Fourier polynomials
int _f_direction_1;
int _f_direction_2;
/// The order of the Legendre expansion
int _l_order;
/// The order of the Fourier expansion
int _f_order;
/// The vector of scalar variables holding the coefficients
std::vector<VariableValue *> _poly_scalars;
/// Legendre polynomial object. TODO address dynamic casting of this object
LegendrePolynomial & _legendre_poly_function;
/// Fourier polynomial object. TODO address dynamic casting of this object
FourierPolynomial & _fourier_poly_function;
private:
};
template<>
InputParameters validParams<FourierLegendreReconstruction>();
#endif
/****************************************************************/
/* 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 FOURIERPOLYNOMIAL_H
#define FOURIERPOLYNOMIAL_H
#include "Function.h"
#include "math.h"
class FourierPolynomial : public Function
{
public:
FourierPolynomial(const InputParameters & parameters);
virtual ~FourierPolynomial();
virtual Real value(Real t, const Point & p);
Real getPolynomialValue(Real t, Real p1, Real p2, int n);
protected:
private:
bool _dbg; // Debug flag to print debug output
};
template<>
InputParameters validParams<FourierPolynomial>();
#endif
/****************************************************************/
/* 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 LEGENDREPOLYNOMIAL_H
#define LEGENDREPOLYNOMIAL_H
#include "Function.h"
#include "math.h"
class LegendrePolynomial : public Function
{
public:
LegendrePolynomial(const InputParameters & parameters);
virtual ~LegendrePolynomial();
virtual Real value(Real t, const Point & p);
Real getPolynomialValue(Real t, Real p, int n);
protected:
private:
std::vector<Real> _geom_norm; // Pin Radius that is used for normalization
Real _dz; // Total length of the domain
bool _dbg; // Debug flag to print debug output
};
template<>
InputParameters validParams<LegendrePolynomial>();
#endif
......@@ -22,6 +22,9 @@ protected:
virtual Real computeDT() override;
virtual void step() override;
virtual bool converged() override;
private:
Real _dt;
};
#endif //MOON_NEKTIMESTEPPER_H
/****************************************************************/
/* 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 NEKSIDEINTEGRALVARIABLEUSEROBJECT_H
#define NEKSIDEINTEGRALVARIABLEUSEROBJECT_H
#include "SideIntegralUserObject.h"
#include "MooseVariableInterface.h"
#include "LegendrePolynomial.h"
#include "FourierPolynomial.h"
//Forward Declarations
class NekSideIntegralVariableUserObject;
template<>
InputParameters validParams<NekSideIntegralVariableUserObject>();
/**
* This postprocessor computes the projection of solution field to an expansion
*/
class NekSideIntegralVariableUserObject :
public SideIntegralUserObject,
public MooseVariableInterface
{
public:
NekSideIntegralVariableUserObject(const InputParameters & parameters);
protected:
virtual Real computeQpIntegral() override;
virtual void finalize() override;
/// Holds the solution at current quadrature points
const VariableValue & _u;
/// Legendre polynomial object. TODO address dynamic casting of this object
LegendrePolynomial & _legendre_poly_function;
/// Fourier polynomial object. TODO address dynamic casting of this object
FourierPolynomial & _fourier_poly_function;
/// The coordinate directions of the integration for Legendre polynomial
int _l_direction;
/// The coordinate directions of the itnegration for Fourier polynomials
int _f_direction_1;
int _f_direction_2;
/// The order of the Legendre polynomial
int _l_order;
/// The order of the Fourier polynomial
int _f_order;
/// The name of the aux scalar index by l_order
std::string _aux_scalar_name;
/// The coupled gradient for heat flux
const VariableGradient & _coupled_grad;
/// Thermal conductivity (diffusion coefficient)
const MaterialProperty<Real> & _diffusion_coefficient;
/// The name of the post processor that calculates the surface area
const PostprocessorValue & _surface_area_pp;
};
#endif