Skip to content
Snippets Groups Projects
Unverified Commit 6f5633f5 authored by Dmitri Naumov's avatar Dmitri Naumov Committed by GitHub
Browse files

Merge pull request #2685 from TomFischer/LineSourceTerm

Implementation of source terms for lines
parents 0fdd8bb1 7e0c4f7c
No related branches found
No related tags found
No related merge requests found
Showing
with 867 additions and 0 deletions
Declares a source term that is defined on a line shaped domain.
The name of the parameter that defines the value that should be used for the source
term. The parameter have to defined on the line domain.
The user should carefully check which physical quantity that parameter is.
......@@ -127,3 +127,112 @@ AddTest(
t2_1D2bt_pcs_0_ts_1500_t_3888.000000.vtu t2_1D2bt_pcs_0_ts_1500_t_3888.000000.vtu temperature temperature 10e-12 0.0
REQUIREMENTS NOT OGS_USE_MPI
)
AddTest(
NAME HeatConduction_1D_LineSourceTerm
PATH
Parabolic/T/1D_line_source_term_tests/
EXECUTABLE ogs
EXECUTABLE_ARGS line_source_term.prj
TESTER vtkdiff
DIFF_DATA
mesh_1_line_100.vtu source_term_at_entire_line_pcs_0_ts_1_t_1.000000.vtu analytical_temperature temperature 1e-13 1e-13
REQUIREMENTS NOT OGS_USE_MPI
)
# tests for line source term implementation
AddTest(
NAME HeatConduction_2D_LineSourceTermLeft
PATH Parabolic/T/2D_source_term_tests/line_source_term_left
EXECUTABLE ogs
EXECUTABLE_ARGS source_term_left.prj
TESTER vtkdiff
DIFF_DATA
source_term_left_pcs_0_ts_1_t_1.000000.vtu source_term_left_pcs_0_ts_1_t_1.000000.vtu temperature temperature 1e-15 0.0
source_term_left_pcs_0_ts_1_t_1.000000.vtu source_term_left_pcs_0_ts_1_t_1.000000.vtu heat_flux_x heat_flux_x 1e-15 0.0
REQUIREMENTS NOT OGS_USE_MPI
)
# For the special setup with a 'dirac' line source term at x=0.5 the
# analytical solution in 2 dimensions is valid:
# u(x,y) = -ln(sqrt((x-0.5)^2))/(2 * Pi)
AddTest(
NAME HeatConduction_2D_LineSourceTermMiddle
PATH Parabolic/T/2D_source_term_tests/line_source_term_x_0.5
EXECUTABLE ogs
EXECUTABLE_ARGS line_source_term_x_0.5.prj
TESTER vtkdiff
DIFF_DATA
source_term_middle_pcs_0_ts_1_t_1.000000.vtu source_term_middle_pcs_0_ts_1_t_1.000000.vtu temperature temperature 4e-15 2e-14
source_term_middle_pcs_0_ts_1_t_1.000000.vtu source_term_middle_pcs_0_ts_1_t_1.000000.vtu heat_flux_x heat_flux_x 7e-14 0.0
REQUIREMENTS NOT OGS_USE_MPI
)
AddTest(
NAME HeatConduction_2D_LineSourceTermMiddle_Restricted
PATH
Parabolic/T/2D_source_term_tests/line_source_term_x_0.5_restricted_to_middle
EXECUTABLE ogs
EXECUTABLE_ARGS line_source_term_x_0.5.prj
TESTER vtkdiff
DIFF_DATA
source_term_middle_restricted_pcs_0_ts_1_t_1.000000.vtu source_term_middle_restricted_pcs_0_ts_1_t_1.000000.vtu temperature temperature 1e-15 0.0
source_term_middle_restricted_pcs_0_ts_1_t_1.000000.vtu source_term_middle_restricted_pcs_0_ts_1_t_1.000000.vtu heat_flux_x heat_flux_x 3e-15 4e-7
REQUIREMENTS NOT OGS_USE_MPI
)
# tests for line source term implementation on a cubic domain
AddTest(
NAME HeatConduction_3D_LineSourceTermMiddle
PATH
Parabolic/T/3D_line_source_term_tests/3D_line_source_term_middle
EXECUTABLE ogs
EXECUTABLE_ARGS line_source_term_x_0.5_y_0.5.prj
TESTER vtkdiff
DIFF_DATA
3D_line_source_term_pcs_0_ts_1_t_1.000000.vtu 3D_line_source_term_pcs_0_ts_1_t_1.000000.vtu temperature temperature 1e-15 0.0
3D_line_source_term_pcs_0_ts_1_t_1.000000.vtu 3D_line_source_term_pcs_0_ts_1_t_1.000000.vtu heat_flux_x heat_flux_x 7e-15 7e-13
REQUIREMENTS NOT OGS_USE_MPI
)
# tests for line source term implementation on a cubic domain
AddTest(
NAME HeatConduction_3D_LineSourceTermMiddle_Restricted
PATH
Parabolic/T/3D_line_source_term_tests/3D_line_source_term_middle_restricted
EXECUTABLE ogs
EXECUTABLE_ARGS line_source_term_x_0.5_y_0.5_restricted.prj
TESTER vtkdiff
DIFF_DATA
3D_line_source_term_restricted_pcs_0_ts_1_t_1.000000.vtu 3D_line_source_term_restricted_pcs_0_ts_1_t_1.000000.vtu temperature temperature 1e-15 0.0
3D_line_source_term_restricted_pcs_0_ts_1_t_1.000000.vtu 3D_line_source_term_restricted_pcs_0_ts_1_t_1.000000.vtu heat_flux_x heat_flux_x 1.1e-15 5e-12
REQUIREMENTS NOT OGS_USE_MPI
)
# tests for line source term implementation on a cylindrical domain
# For the special setup with a line source term at position (xi, eta) the
# analytical solution in 2 dimensions is valid:
# u(x,y) = -ln(sqrt((x-xi)^2+(y-eta)^2))/(2 * Pi)
AddTest(
NAME HeatConduction_3D_LineSourceTermInMiddleOfCylinder_49k_prisms
PATH
Parabolic/T/3D_line_source_term_tests/3D_line_source_term_in_cylinder/49k_prisms
EXECUTABLE ogs
EXECUTABLE_ARGS line_source_term_in_cylinder.prj
TESTER vtkdiff
DIFF_DATA
Cylinder_r_1_h_1_prism_49k.vtu 3D_line_source_term_in_cylinder_49k_pcs_0_ts_1_t_1.000000.vtu analytical_solution_temperature temperature 0.2 0.0
REQUIREMENTS NOT OGS_USE_MPI
)
AddTest(
NAME LARGE_HeatConduction_3D_LineSourceTermInMiddleOfCylinder_286k_prisms
PATH
Parabolic/T/3D_line_source_term_tests/3D_line_source_term_in_cylinder/286k_prisms
EXECUTABLE ogs
EXECUTABLE_ARGS line_source_term_in_cylinder.prj
TESTER vtkdiff
DIFF_DATA
Cylinder_r_1_h_1_prism_286k.vtu 3D_line_source_term_in_cylinder_286k_pcs_0_ts_1_t_1.000000.vtu analytical_solution_temperature temperature 4e-3 0.0
REQUIREMENTS NOT OGS_USE_MPI
)
/**
* \file
* \copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#include "CreateLineSourceTerm.h"
#include "BaseLib/ConfigTree.h"
#include "BaseLib/FileTools.h"
#include "MeshLib/Mesh.h"
#include "NumLib/DOF/LocalToGlobalIndexMap.h"
#include "ParameterLib/Utils.h"
#include "LineSourceTerm.h"
namespace ProcessLib
{
std::unique_ptr<SourceTerm> createLineSourceTerm(
BaseLib::ConfigTree const& config, unsigned const bulk_mesh_dimension,
MeshLib::Mesh const& source_term_mesh,
std::unique_ptr<NumLib::LocalToGlobalIndexMap> source_term_dof_table,
std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
unsigned const integration_order, unsigned const shapefunction_order)
{
//! \ogs_file_param{prj__process_variables__process_variable__source_terms__source_term__type}
config.checkConfigParameter("type", "Line");
DBUG("Constructing LineSourceTerm from config.");
// source term field name
auto const& line_source_term_parameter_name =
//! \ogs_file_param{prj__process_variables__process_variable__source_terms__source_term__Line__parameter}
config.getConfigParameter<std::string>("parameter");
auto& line_source_term = ParameterLib::findParameter<double>(
line_source_term_parameter_name, parameters, 1, &source_term_mesh);
DBUG("Using '%s' as line source term parameter.",
line_source_term.name.c_str());
return std::make_unique<LineSourceTerm>(
bulk_mesh_dimension, source_term_mesh, std::move(source_term_dof_table),
integration_order, shapefunction_order, line_source_term);
}
} // namespace ProcessLib
/**
* \file
* \copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#pragma once
#include <memory>
#include <vector>
namespace BaseLib
{
class ConfigTree;
}
namespace MeshLib
{
class Mesh;
}
namespace NumLib
{
class LocalToGlobalIndexMap;
}
namespace ParameterLib
{
struct ParameterBase;
}
namespace ProcessLib
{
class SourceTerm;
std::unique_ptr<SourceTerm> createLineSourceTerm(
BaseLib::ConfigTree const& config, unsigned const bulk_mesh_dimension,
MeshLib::Mesh const& source_term_mesh,
std::unique_ptr<NumLib::LocalToGlobalIndexMap> source_term_dof_table,
std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
unsigned const integration_order, unsigned const shapefunction_order);
} // namespace ProcessLib
......@@ -10,6 +10,7 @@
#include "CreateSourceTerm.h"
#include "CreateLineSourceTerm.h"
#include "CreateNodalSourceTerm.h"
#include "CreateVolumetricSourceTerm.h"
#ifdef OGS_USE_PYTHON
......@@ -76,6 +77,22 @@ std::unique_ptr<SourceTerm> createSourceTerm(
parameters);
}
if (type == "Line")
{
std::unique_ptr<NumLib::LocalToGlobalIndexMap> dof_table_source_term(
dof_table_bulk.deriveBoundaryConstrainedMap(
variable_id, {*config.component_id},
std::move(source_term_mesh_subset)));
auto const& bulk_mesh_dimension =
dof_table_bulk.getMeshSubset(variable_id, *config.component_id)
.getMesh()
.getDimension();
return ProcessLib::createLineSourceTerm(
config.config, bulk_mesh_dimension, config.mesh,
std::move(dof_table_source_term), parameters, integration_order,
shapefunction_order);
}
if (type == "Volumetric")
{
std::unique_ptr<NumLib::LocalToGlobalIndexMap> dof_table_source_term(
......
/**
* \file
* \copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#include "LineSourceTerm.h"
#include "ProcessLib/Utils/CreateLocalAssemblers.h"
namespace ProcessLib
{
LineSourceTerm::LineSourceTerm(
unsigned const bulk_mesh_dimension, MeshLib::Mesh const& source_term_mesh,
std::unique_ptr<NumLib::LocalToGlobalIndexMap> source_term_dof_table,
unsigned const integration_order, unsigned const shapefunction_order,
ParameterLib::Parameter<double> const& line_source_term_parameter)
: SourceTerm(std::move(source_term_dof_table)),
_line_source_term_parameter(line_source_term_parameter)
{
ProcessLib::createLocalAssemblers<LineSourceTermLocalAssembler>(
bulk_mesh_dimension, source_term_mesh.getElements(),
*_source_term_dof_table, shapefunction_order, _local_assemblers,
source_term_mesh.isAxiallySymmetric(), integration_order,
_line_source_term_parameter);
}
void LineSourceTerm::integrate(const double t, GlobalVector const& /*x*/,
GlobalVector& b, GlobalMatrix* /*jac*/) const
{
DBUG("Assemble LineSourceTerm.");
// Call global assembler for each local assembly item.
GlobalExecutor::executeMemberOnDereferenced(
&LineSourceTermLocalAssemblerInterface::integrate, _local_assemblers,
*_source_term_dof_table, t, b);
}
} // namespace ProcessLib
/**
* \file
* \copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#pragma once
#include <memory>
#include <vector>
#include "SourceTerm.h"
#include "LineSourceTermFEM.h"
namespace ProcessLib
{
class LineSourceTerm final : public SourceTerm
{
public:
LineSourceTerm(
unsigned const bulk_mesh_dimension,
MeshLib::Mesh const& source_term_mesh,
std::unique_ptr<NumLib::LocalToGlobalIndexMap> source_term_dof_table,
unsigned const integration_order, unsigned const shapefunction_order,
ParameterLib::Parameter<double> const& line_source_term_parameter);
void integrate(const double t, GlobalVector const& x, GlobalVector& b,
GlobalMatrix* jac) const override;
private:
ParameterLib::Parameter<double> const& _line_source_term_parameter;
std::vector<std::unique_ptr<LineSourceTermLocalAssemblerInterface>>
_local_assemblers;
};
} // namespace ProcessLib
/**
* \file
* \copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#pragma once
#include <vector>
#include "MathLib/LinAlg/Eigen/EigenMapTools.h"
#include "NumLib/DOF/DOFTableUtil.h"
#include "NumLib/Fem/FiniteElement/TemplateIsoparametric.h"
#include "ParameterLib/Parameter.h"
#include "ProcessLib/LocalAssemblerTraits.h"
#include "ProcessLib/Utils/InitShapeMatrices.h"
namespace ProcessLib
{
class LineSourceTermLocalAssemblerInterface
{
public:
virtual void integrate(
std::size_t const id,
NumLib::LocalToGlobalIndexMap const& source_term_dof_table,
double const t, GlobalVector& b) = 0;
virtual ~LineSourceTermLocalAssemblerInterface() = default;
};
const unsigned NUM_NODAL_DOF = 1;
template <typename ShapeFunction, typename IntegrationMethod,
unsigned GlobalDim>
class LineSourceTermLocalAssembler final
: public LineSourceTermLocalAssemblerInterface
{
using ShapeMatricesType = ShapeMatrixPolicyType<ShapeFunction, GlobalDim>;
using LocalAssemblerTraits = ProcessLib::LocalAssemblerTraits<
ShapeMatricesType, ShapeFunction::NPOINTS, NUM_NODAL_DOF, GlobalDim>;
using NodalVectorType = typename LocalAssemblerTraits::LocalVector;
using NodalRowVectorType = typename ShapeMatricesType::NodalRowVectorType;
public:
LineSourceTermLocalAssembler(
MeshLib::Element const& element,
std::size_t const local_matrix_size,
bool const is_axially_symmetric,
unsigned const integration_order,
ParameterLib::Parameter<double> const& line_source_term_parameter)
: _parameter(line_source_term_parameter),
_integration_method(integration_order),
_local_rhs(local_matrix_size)
{
unsigned const n_integration_points =
_integration_method.getNumberOfPoints();
auto const shape_matrices =
initShapeMatrices<ShapeFunction, ShapeMatricesType,
IntegrationMethod, GlobalDim>(
element, is_axially_symmetric, _integration_method);
for (unsigned ip = 0; ip < n_integration_points; ip++)
{
_ip_data.emplace_back(
_integration_method.getWeightedPoint(ip).getWeight() *
shape_matrices[ip].integralMeasure * shape_matrices[ip].detJ *
shape_matrices[ip].N);
}
}
void integrate(std::size_t const id,
NumLib::LocalToGlobalIndexMap const& source_term_dof_table,
double const t, GlobalVector& b) override
{
_local_rhs.setZero();
unsigned const n_integration_points =
_integration_method.getNumberOfPoints();
ParameterLib::SpatialPosition pos;
pos.setElementID(id);
for (unsigned ip = 0; ip < n_integration_points; ip++)
{
pos.setIntegrationPoint(ip);
auto const st_val = _parameter(t, pos)[0];
_local_rhs.noalias() += st_val * _ip_data[ip];
}
auto const indices = NumLib::getIndices(id, source_term_dof_table);
b.add(indices, _local_rhs);
}
private:
ParameterLib::Parameter<double> const& _parameter;
IntegrationMethod const _integration_method;
std::vector<NodalRowVectorType,
Eigen::aligned_allocator<NodalRowVectorType>>
_ip_data;
NodalVectorType _local_rhs;
};
} // namespace ProcessLib
File added
File added
File added
<?xml version="1.0" encoding="ISO-8859-1"?>
<OpenGeoSysProject>
<meshes>
<mesh>mesh_1_line_100.vtu</mesh>
<mesh>line_1_entire_line.vtu</mesh>
<mesh>line_1_left.vtu</mesh>
<mesh>line_1_right.vtu</mesh>
</meshes>
<processes>
<process>
<name>HeatConduction</name>
<type>HEAT_CONDUCTION</type>
<integration_order>2</integration_order>
<thermal_conductivity>lambda</thermal_conductivity>
<heat_capacity>c_p</heat_capacity>
<density>rho</density>
<process_variables>
<process_variable>temperature</process_variable>
</process_variables>
<secondary_variables>
<secondary_variable type="static" internal_name="heat_flux_x" output_name="heat_flux_x"/>
</secondary_variables>
</process>
</processes>
<time_loop>
<processes>
<process ref="HeatConduction">
<nonlinear_solver>basic_picard</nonlinear_solver>
<convergence_criterion>
<type>DeltaX</type>
<norm_type>NORM2</norm_type>
<abstol>1.e-6</abstol>
</convergence_criterion>
<time_discretization>
<type>BackwardEuler</type>
</time_discretization>
<time_stepping>
<type>FixedTimeStepping</type>
<t_initial> 0.0 </t_initial>
<t_end> 1 </t_end>
<timesteps>
<pair>
<repeat>1</repeat>
<delta_t>1</delta_t>
</pair>
</timesteps>
</time_stepping>
</process>
</processes>
<output>
<type>VTK</type>
<prefix>source_term_at_entire_line</prefix>
<timesteps>
<pair>
<repeat> 10000 </repeat>
<each_steps> 1 </each_steps>
</pair>
</timesteps>
<variables>
<variable> temperature </variable>
<variable> heat_flux_x </variable>
</variables>
</output>
</time_loop>
<parameters>
<parameter>
<name>lambda</name>
<type>Constant</type>
<value>1</value>
</parameter>
<parameter>
<name>c_p</name>
<type>Constant</type>
<value>0</value>
</parameter>
<parameter>
<name>rho</name>
<type>Constant</type>
<value>0</value>
</parameter>
<parameter>
<name>T0</name>
<type>Constant</type>
<value>0</value>
</parameter>
<parameter>
<name>HeatSource</name>
<type>Constant</type>
<value>1</value>
</parameter>
</parameters>
<process_variables>
<process_variable>
<name>temperature</name>
<components>1</components>
<order>1</order>
<initial_condition>T0</initial_condition>
<boundary_conditions>
<boundary_condition>
<mesh>line_1_left</mesh>
<type>Dirichlet</type>
<parameter>T0</parameter>
</boundary_condition>
<boundary_condition>
<mesh>line_1_right</mesh>
<type>Dirichlet</type>
<parameter>T0</parameter>
</boundary_condition>
</boundary_conditions>
<source_terms>
<source_term>
<mesh>line_1_entire_line</mesh>
<type>Line</type>
<parameter>HeatSource</parameter>
</source_term>
</source_terms>
</process_variable>
</process_variables>
<nonlinear_solvers>
<nonlinear_solver>
<name>basic_picard</name>
<type>Picard</type>
<max_iter>10</max_iter>
<linear_solver>general_linear_solver</linear_solver>
</nonlinear_solver>
</nonlinear_solvers>
<linear_solvers>
<linear_solver>
<name>general_linear_solver</name>
<lis>-i cg -p jacobi -tol 1e-16 -maxiter 10000</lis>
<eigen>
<solver_type>CG</solver_type>
<precon_type>DIAGONAL</precon_type>
<max_iteration_step>10000</max_iteration_step>
<error_tolerance>1e-16</error_tolerance>
</eigen>
<petsc>
<prefix>gw</prefix>
<parameters>-gw_ksp_type cg -gw_pc_type bjacobi -gw_ksp_rtol 1e-16 -gw_ksp_max_it 10000</parameters>
</petsc>
</linear_solver>
</linear_solvers>
</OpenGeoSysProject>
File added
File added
File added
File added
<?xml version="1.0" encoding="ISO-8859-1"?>
<OpenGeoSysProject>
<meshes>
<mesh>mesh.vtu</mesh>
<mesh>mesh_left.vtu</mesh>
<mesh>mesh_right.vtu</mesh>
</meshes>
<processes>
<process>
<name>HeatConduction</name>
<type>HEAT_CONDUCTION</type>
<integration_order>2</integration_order>
<thermal_conductivity>lambda</thermal_conductivity>
<heat_capacity>c_p</heat_capacity>
<density>rho</density>
<process_variables>
<process_variable>temperature</process_variable>
</process_variables>
<secondary_variables>
<secondary_variable type="static" internal_name="heat_flux_x" output_name="heat_flux_x"/>
</secondary_variables>
</process>
</processes>
<time_loop>
<processes>
<process ref="HeatConduction">
<nonlinear_solver>basic_picard</nonlinear_solver>
<convergence_criterion>
<type>DeltaX</type>
<norm_type>NORM2</norm_type>
<abstol>1.e-6</abstol>
</convergence_criterion>
<time_discretization>
<type>BackwardEuler</type>
</time_discretization>
<time_stepping>
<type>FixedTimeStepping</type>
<t_initial> 0.0 </t_initial>
<t_end> 1 </t_end>
<timesteps>
<pair>
<repeat>1</repeat>
<delta_t>1</delta_t>
</pair>
</timesteps>
</time_stepping>
</process>
</processes>
<output>
<type>VTK</type>
<prefix>source_term_left</prefix>
<timesteps>
<pair>
<repeat> 10000 </repeat>
<each_steps> 1 </each_steps>
</pair>
</timesteps>
<variables>
<variable> temperature </variable>
<variable> heat_flux_x </variable>
</variables>
</output>
</time_loop>
<parameters>
<parameter>
<name>lambda</name>
<type>Constant</type>
<value>1</value>
</parameter>
<parameter>
<name>c_p</name>
<type>Constant</type>
<value>1</value>
</parameter>
<parameter>
<name>rho</name>
<type>Constant</type>
<value>1</value>
</parameter>
<parameter>
<name>T0</name>
<type>Constant</type>
<value>0</value>
</parameter>
<parameter>
<name>HeatSource</name>
<type>Constant</type>
<value>1</value>
</parameter>
</parameters>
<process_variables>
<process_variable>
<name>temperature</name>
<components>1</components>
<order>1</order>
<initial_condition>T0</initial_condition>
<boundary_conditions>
<boundary_condition>
<mesh>mesh_right</mesh>
<type>Dirichlet</type>
<parameter>T0</parameter>
</boundary_condition>
</boundary_conditions>
<source_terms>
<source_term>
<mesh>mesh_left</mesh>
<type>Line</type>
<parameter>HeatSource</parameter>
</source_term>
</source_terms>
</process_variable>
</process_variables>
<nonlinear_solvers>
<nonlinear_solver>
<name>basic_picard</name>
<type>Picard</type>
<max_iter>10</max_iter>
<linear_solver>general_linear_solver</linear_solver>
</nonlinear_solver>
</nonlinear_solvers>
<linear_solvers>
<linear_solver>
<name>general_linear_solver</name>
<lis>-i cg -p jacobi -tol 1e-16 -maxiter 10000</lis>
<eigen>
<solver_type>CG</solver_type>
<precon_type>DIAGONAL</precon_type>
<max_iteration_step>10000</max_iteration_step>
<error_tolerance>1e-16</error_tolerance>
</eigen>
<petsc>
<prefix>gw</prefix>
<parameters>-gw_ksp_type cg -gw_pc_type bjacobi -gw_ksp_rtol 1e-16 -gw_ksp_max_it 10000</parameters>
</petsc>
</linear_solver>
</linear_solvers>
</OpenGeoSysProject>
<?xml version="1.0" encoding="ISO-8859-1"?>
<OpenGeoSysProject>
<meshes>
<mesh>mesh_1x1_quad_100x100.vtu</mesh>
<mesh>mesh_1x1_middle.vtu</mesh>
<mesh>mesh_1x1_left.vtu</mesh>
<mesh>mesh_1x1_right.vtu</mesh>
</meshes>
<processes>
<process>
<name>HeatConduction</name>
<type>HEAT_CONDUCTION</type>
<integration_order>2</integration_order>
<thermal_conductivity>lambda</thermal_conductivity>
<heat_capacity>c_p</heat_capacity>
<density>rho</density>
<process_variables>
<process_variable>temperature</process_variable>
</process_variables>
<secondary_variables>
<secondary_variable type="static" internal_name="heat_flux_x" output_name="heat_flux_x"/>
</secondary_variables>
</process>
</processes>
<time_loop>
<processes>
<process ref="HeatConduction">
<nonlinear_solver>basic_picard</nonlinear_solver>
<convergence_criterion>
<type>DeltaX</type>
<norm_type>NORM2</norm_type>
<abstol>1.e-6</abstol>
</convergence_criterion>
<time_discretization>
<type>BackwardEuler</type>
</time_discretization>
<time_stepping>
<type>FixedTimeStepping</type>
<t_initial> 0.0 </t_initial>
<t_end> 1 </t_end>
<timesteps>
<pair>
<repeat>1</repeat>
<delta_t>1</delta_t>
</pair>
</timesteps>
</time_stepping>
</process>
</processes>
<output>
<type>VTK</type>
<prefix>source_term_middle</prefix>
<timesteps>
<pair>
<repeat> 10000 </repeat>
<each_steps> 1 </each_steps>
</pair>
</timesteps>
<variables>
<variable> temperature </variable>
<variable> heat_flux_x </variable>
</variables>
</output>
</time_loop>
<parameters>
<parameter>
<name>lambda</name>
<type>Constant</type>
<value>1</value>
</parameter>
<parameter>
<name>c_p</name>
<type>Constant</type>
<value>0</value>
</parameter>
<parameter>
<name>rho</name>
<type>Constant</type>
<value>0</value>
</parameter>
<parameter>
<name>T0</name>
<type>Constant</type>
<value>0</value>
</parameter>
<parameter>
<name>HeatSource</name>
<type>Constant</type>
<value>1</value>
</parameter>
</parameters>
<process_variables>
<process_variable>
<name>temperature</name>
<components>1</components>
<order>1</order>
<initial_condition>T0</initial_condition>
<boundary_conditions>
<boundary_condition>
<mesh>mesh_1x1_left</mesh>
<type>Dirichlet</type>
<parameter>T0</parameter>
</boundary_condition>
<boundary_condition>
<mesh>mesh_1x1_right</mesh>
<type>Dirichlet</type>
<parameter>T0</parameter>
</boundary_condition>
</boundary_conditions>
<source_terms>
<source_term>
<mesh>mesh_1x1_middle</mesh>
<type>Line</type>
<parameter>HeatSource</parameter>
</source_term>
</source_terms>
</process_variable>
</process_variables>
<nonlinear_solvers>
<nonlinear_solver>
<name>basic_picard</name>
<type>Picard</type>
<max_iter>10</max_iter>
<linear_solver>general_linear_solver</linear_solver>
</nonlinear_solver>
</nonlinear_solvers>
<linear_solvers>
<linear_solver>
<name>general_linear_solver</name>
<lis>-i cg -p jacobi -tol 1e-16 -maxiter 10000</lis>
<eigen>
<solver_type>CG</solver_type>
<precon_type>DIAGONAL</precon_type>
<max_iteration_step>10000</max_iteration_step>
<error_tolerance>1e-16</error_tolerance>
</eigen>
<petsc>
<prefix>gw</prefix>
<parameters>-gw_ksp_type cg -gw_pc_type bjacobi -gw_ksp_rtol 1e-16 -gw_ksp_max_it 10000</parameters>
</petsc>
</linear_solver>
</linear_solvers>
</OpenGeoSysProject>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment