-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added 1D current_carrying_wire test.
- Loading branch information
Alex Lindsay
committed
Aug 11, 2016
1 parent
4451248
commit 09c2955
Showing
9 changed files
with
275 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef AXISYMMETRICCURLZ_H | ||
#define AXISYMMETRICCURLZ_H | ||
|
||
#include "Kernel.h" | ||
|
||
class AxisymmetricCurlZ; | ||
|
||
template<> | ||
InputParameters validParams<AxisymmetricCurlZ>(); | ||
|
||
class AxisymmetricCurlZ : public Kernel | ||
{ | ||
public: | ||
AxisymmetricCurlZ(const InputParameters & parameters); | ||
virtual ~AxisymmetricCurlZ(); | ||
|
||
protected: | ||
|
||
virtual Real computeQpResidual(); | ||
virtual Real computeQpJacobian(); | ||
|
||
}; | ||
|
||
|
||
#endif /* AXISYMMETRICCURLZ_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#ifndef USERSOURCE_H | ||
#define USERSOURCE_H | ||
|
||
#include "Kernel.h" | ||
|
||
class UserSource; | ||
|
||
template<> | ||
InputParameters validParams<UserSource>(); | ||
|
||
class UserSource : public Kernel | ||
{ | ||
public: | ||
UserSource(const InputParameters & parameters); | ||
virtual ~UserSource(); | ||
|
||
protected: | ||
|
||
virtual Real computeQpResidual(); | ||
virtual Real computeQpJacobian(); | ||
|
||
Real _source; | ||
|
||
}; | ||
|
||
|
||
#endif /* USERSOURCE_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
[Mesh] | ||
type = GeneratedMesh | ||
dim = 1 | ||
nx = 20 | ||
xmax = 2 | ||
xmin = 0 | ||
[] | ||
|
||
[MeshModifiers] | ||
[./vacuum] | ||
type = SubdomainBoundingBox | ||
bottom_left = '1 0 0' | ||
top_right = '2 0 0' | ||
block_id = 1 | ||
[../] | ||
# [./interface] | ||
# type = SideSetsBetweenSubdomains | ||
# master_block = '1' | ||
# paired_block = '0' | ||
# new_boundary = 'interface' | ||
# depends_on = 'vacuum' | ||
# [../] | ||
[] | ||
|
||
|
||
[Problem] | ||
[] | ||
|
||
[Preconditioning] | ||
[./smp] | ||
type = SMP | ||
full = true | ||
[../] | ||
[] | ||
|
||
[Executioner] | ||
type = Steady | ||
solve_type = NEWTON | ||
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -ksp_type -snes_linesearch_minlambda' | ||
petsc_options_value = 'lu NONZERO 1.e-10 preonly 1e-3' | ||
[] | ||
|
||
[Outputs] | ||
print_perf_log = true | ||
print_linear_residuals = false | ||
[./out] | ||
type = Exodus | ||
[../] | ||
[] | ||
|
||
[Kernels] | ||
[./curl_z] | ||
type = AxisymmetricCurlZ | ||
variable = Bphi | ||
[../] | ||
[./source] | ||
type = UserSource | ||
variable = Bphi | ||
source_magnitude = 1 | ||
block = 0 | ||
[../] | ||
[] | ||
|
||
[Variables] | ||
[./Bphi] | ||
[../] | ||
[] | ||
|
||
[BCs] | ||
[./center_of_wire] | ||
type = DirichletBC | ||
boundary = left | ||
variable = Bphi | ||
value = 0 | ||
[../] | ||
[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include "AxisymmetricCurlZ.h" | ||
|
||
template<> | ||
InputParameters validParams<AxisymmetricCurlZ>() | ||
{ | ||
InputParameters params = validParams<Kernel>(); | ||
return params; | ||
} | ||
|
||
AxisymmetricCurlZ::AxisymmetricCurlZ(const InputParameters & parameters) : | ||
Kernel(parameters) | ||
{ | ||
} | ||
|
||
AxisymmetricCurlZ::~AxisymmetricCurlZ() | ||
{ | ||
} | ||
|
||
Real | ||
AxisymmetricCurlZ::computeQpResidual() | ||
{ | ||
return _test[_i][_qp] * (_u[_qp] / _q_point[_qp](0) + _grad_u[_qp](0)); | ||
} | ||
|
||
Real | ||
AxisymmetricCurlZ::computeQpJacobian() | ||
{ | ||
return _test[_i][_qp] * (_phi[_j][_qp] / _q_point[_qp](0) + _grad_phi[_j][_qp](0)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "UserSource.h" | ||
|
||
template<> | ||
InputParameters validParams<UserSource>() | ||
{ | ||
InputParameters params = validParams<Kernel>(); | ||
params.addRequiredParam<Real>("source_magnitude", "The numerical value of the source magnitude."); | ||
return params; | ||
} | ||
|
||
UserSource::UserSource(const InputParameters & parameters) : | ||
Kernel(parameters), | ||
_source(getParam<Real>("source_magnitude")) | ||
{ | ||
} | ||
|
||
UserSource::~UserSource() | ||
{ | ||
} | ||
|
||
Real | ||
UserSource::computeQpResidual() | ||
{ | ||
return -_test[_i][_qp] * _source; | ||
} | ||
|
||
Real | ||
UserSource::computeQpJacobian() | ||
{ | ||
return 0.; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
[Mesh] | ||
type = GeneratedMesh | ||
dim = 1 | ||
nx = 20 | ||
xmax = 2 | ||
xmin = 0 | ||
[] | ||
|
||
[MeshModifiers] | ||
[./vacuum] | ||
type = SubdomainBoundingBox | ||
bottom_left = '1 0 0' | ||
top_right = '2 0 0' | ||
block_id = 1 | ||
[../] | ||
# [./interface] | ||
# type = SideSetsBetweenSubdomains | ||
# master_block = '1' | ||
# paired_block = '0' | ||
# new_boundary = 'interface' | ||
# depends_on = 'vacuum' | ||
# [../] | ||
[] | ||
|
||
|
||
[Problem] | ||
[] | ||
|
||
[Preconditioning] | ||
[./smp] | ||
type = SMP | ||
full = true | ||
[../] | ||
[] | ||
|
||
[Executioner] | ||
type = Steady | ||
solve_type = NEWTON | ||
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -ksp_type -snes_linesearch_minlambda' | ||
petsc_options_value = 'lu NONZERO 1.e-10 preonly 1e-3' | ||
[] | ||
|
||
[Outputs] | ||
print_perf_log = true | ||
print_linear_residuals = false | ||
[./out] | ||
type = Exodus | ||
[../] | ||
[] | ||
|
||
[Kernels] | ||
[./curl_z] | ||
type = AxisymmetricCurlZ | ||
variable = Bphi | ||
[../] | ||
[./source] | ||
type = UserSource | ||
variable = Bphi | ||
source_magnitude = 1 | ||
block = 0 | ||
[../] | ||
[] | ||
|
||
[Variables] | ||
[./Bphi] | ||
[../] | ||
[] | ||
|
||
[BCs] | ||
[./center_of_wire] | ||
type = DirichletBC | ||
boundary = left | ||
variable = Bphi | ||
value = 0 | ||
[../] | ||
[] |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[Tests] | ||
[./current_carrying_wire] | ||
type = 'Exodiff' | ||
input = 'current_carrying_wire.i' | ||
exodiff = 'current_carrying_wire_out.e' | ||
[../] | ||
[] |