1D Heat Equation Solver 1.0
Computational Methods Assignment 2025
Loading...
Searching...
No Matches
Analytical Class Reference

Analytical solution for the 1D heat equation. More...

#include <analytical.hpp>

Collaboration diagram for Analytical:
Collaboration graph

Static Public Member Functions

static double solve (double t, double x, const PhysParams &phys)
 Compute the exact temperature at a given time and position.
static std::vector< double > get_profile (double t, const std::vector< double > &x_grid, const PhysParams &phys)
 Generate a full temperature profile for a set of grid points.

Detailed Description

Analytical solution for the 1D heat equation.

Problem: dT/dt = D * d^2T/dx^2 IC: T(x, 0) = Tin BC: T(0, t) = T(L, t) = Tsur

Solution (Series expansion): T(x,t) = Tsur + (Tin - Tsur) * 4/pi * Sum_{k=0,1,...} [ 1/(2k+1) * sin((2k+1)*pi*x/L) * exp(-D*((2k+1)*pi/L)^2 * t) ]

Definition at line 18 of file analytical.hpp.

Member Function Documentation

◆ get_profile()

std::vector< double > Analytical::get_profile ( double t,
const std::vector< double > & x_grid,
const PhysParams & phys )
static

Generate a full temperature profile for a set of grid points.

Parameters
tTime [h]
x_gridVector of positions
physPhysical parameters
Returns
Vector of temperatures corresponding to x_grid

Definition at line 37 of file analytical.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ solve()

double Analytical::solve ( double t,
double x,
const PhysParams & phys )
static

Compute the exact temperature at a given time and position.

Parameters
tTime [h]
xPosition [cm]
physPhysical parameters (L, D, Tin, Tsur)
Returns
Temperature [°C]

Definition at line 6 of file analytical.cpp.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: