Molecular Dynamics  v0.4
Project for the Practical hosted by the Scientific Computing Chair
Public Member Functions | List of all members
FlowThermostat Class Reference

Class for controling the temperature of a flow. More...

#include <FlowThermostat.h>

Inheritance diagram for FlowThermostat:
Inheritance graph
Collaboration diagram for FlowThermostat:
Collaboration graph

Public Member Functions

 FlowThermostat (Model &model, double temperatureInit, double temperatureTarget, double maxTemperatureChange, int dimensions)
 Construct a flow thermostat for a model. More...
 
double calculateKineticEnergy () override
 Helper method to calculate the current kinetic energy of the system. (Fixed particles excluded). More...
 
std::array< double, 3 > calculateAverageVelocity ()
 
double calculateTemperature () override
 Helper method to calculate the current temperature of the system. More...
 
void setTemperatureOfTheSystemViaVelocityScaling () override
 Set the temperature of the current system to targetTemperature. More...
 
void setTemperatureOfTheSystemViaGradualVelocityScaling () override
 Set the temperature of the current system to targetTemperature, if the change in temperature does not exceed maxTemperatureChange. If it does, the temperature will only be adjusted by the value of maxTemperatureChange. More...
 
- Public Member Functions inherited from Thermostat
 Thermostat (Model &model, double temperatureInit, double temperatureTarget, double maxTemperatureChange, int dimensions)
 Construct a thermostat for a model. More...
 
void initialiseSystem ()
 Set the temperature of the system to initTemperature before starting the simultion by applying Brownian Motion to all particles. More...
 
void setTargetTemperature (double targetTemperature)
 
virtual ~Thermostat ()=default
 

Additional Inherited Members

- Protected Attributes inherited from Thermostat
Modelmodel
 
double initTemperature
 
double targetTemperature
 
double maxTemperatureChange
 
int dimensions
 

Detailed Description

Class for controling the temperature of a flow.

Constructor & Destructor Documentation

◆ FlowThermostat()

FlowThermostat::FlowThermostat ( Model model,
double  temperatureInit,
double  temperatureTarget,
double  maxTemperatureChange,
int  dimensions 
)

Construct a flow thermostat for a model.

Parameters
modelModel on which the thermostat is applied.
temperatureInitThe initial temperature of the system.
temperatureTargetTemperature the system should reach and preserve
maxTemperatureChangeThe maximal absolute temperature change that is allowed for one application of the thermostat.
dimensionsNumber of dimensions in which the simulation takes place.

Member Function Documentation

◆ calculateAverageVelocity()

std::array< double, 3 > FlowThermostat::calculateAverageVelocity ( )

Helper method to calculate the current average velocity of the particles within the system. (Fixed particles excluded).

Returns
Current avg velocity of the system.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ calculateKineticEnergy()

double FlowThermostat::calculateKineticEnergy ( )
overridevirtual

Helper method to calculate the current kinetic energy of the system. (Fixed particles excluded).

Returns
Current kinetic energy of the system.

Implements Thermostat.

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

◆ calculateTemperature()

double FlowThermostat::calculateTemperature ( )
overridevirtual

Helper method to calculate the current temperature of the system.

Returns
Current temperature of the system.

Implements Thermostat.

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

◆ setTemperatureOfTheSystemViaGradualVelocityScaling()

void FlowThermostat::setTemperatureOfTheSystemViaGradualVelocityScaling ( )
overridevirtual

Set the temperature of the current system to targetTemperature, if the change in temperature does not exceed maxTemperatureChange. If it does, the temperature will only be adjusted by the value of maxTemperatureChange.

Implements Thermostat.

Here is the call graph for this function:

◆ setTemperatureOfTheSystemViaVelocityScaling()

void FlowThermostat::setTemperatureOfTheSystemViaVelocityScaling ( )
overridevirtual

Set the temperature of the current system to targetTemperature.

Implements Thermostat.

Here is the call graph for this function:

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