Class where the first inverse heat transfer problem tutorial is solved using the Parameterization of the heat flux. More...
#include <IHTP01inverseLaplacian.H>
Public Member Functions | |
IHTP01inverseLaplacian_paramBC (int argc, char *argv[]) | |
void | solveAdditional () |
Solve the additional problem. | |
void | postProcess (word folder, word heatFluxFieldName, scalar innerField=0.0) |
Post process all the estimated heat fluxes heatFluxFieldName inside folder computing the relative error field with respect to gTrue with the related L2 and Linfty norms. | |
void | assignDirectBC () |
Assign the correct boundary condition to direct problem and assign -g/k to the hotSide patch. | |
void | solveTrue () |
Perform a solution of the direct problem with the correct boundary conditions. | |
Eigen::VectorXd | bestApproximator () |
Compute the best approximation of the true heat flux gTrue in the parameterized space. | |
Eigen::VectorXd | bestInterpolation () |
Compute the best interpolation of the true heat flux gTrue in the parameterized space. | |
Public Member Functions inherited from inverseLaplacianProblem_paramBC | |
inverseLaplacianProblem_paramBC () | |
Null constructor. | |
inverseLaplacianProblem_paramBC (int argc, char *argv[]) | |
Construct with argc and argv. Reads the thermocouples dictionary. | |
virtual | ~inverseLaplacianProblem_paramBC () |
Destructor. | |
virtual void | set_gBaseFunctions () |
Define the base functions used for the parametrization of the heat flux g The center of each base function is the projection of each thermocouple on the boundary hotSide. | |
void | set_gBaseFunctionsPOD (label Nmodes) |
Performs POD on the RBF basis functions. | |
void | set_gParametrized (word baseFuncType, scalar _shapeParameter=1) |
Set initial heat flux for the parameterized BC method. | |
void | update_gParametrized (List< scalar > weigths) |
Update the boundary heat flux. | |
void | parameterizedBCoffline (bool force=0) |
Performs offline computation for the parameterized BC method, if the offline directory "./ITHACAoutputs/offlineParamBC" exists, it reads the solution from there. | |
Eigen::VectorXd | parameterizedBC (word linSys_solver="fullPivLU", double regPar=0) |
Solve the online phase. | |
void | parameterizedBCpostProcess (Eigen::VectorXd weigths) |
Reconstruct the temperature field and compute the cost function J. | |
void | reconstructT () |
Reconstuct the field T using the offline computed fields. | |
Public Member Functions inherited from inverseLaplacianProblem | |
inverseLaplacianProblem () | |
Null constructor. | |
inverseLaplacianProblem (int argc, char *argv[]) | |
Construct with argc and argv. Reads the thermocouples dictionary. | |
virtual | ~inverseLaplacianProblem () |
Destructor. | |
void | set_g () |
Set the right g size and fills it with zeros. | |
volScalarField | list2Field (List< scalar > list, scalar innerField=0.0) |
Create a field with the hotSide boundary heat flux at the hotSide bounday cells for visualization. | |
void | set_valueFraction () |
Set valueFraction list values for Robin condition. | |
void | solveDirect () |
Solve direct problem. | |
void | solve (const char *problem) |
Solve Laplacian problem without source term. | |
virtual void | readThermocouples () |
Identifies in the mesh the cells corresponding to the termocouples locations. | |
Eigen::VectorXd | fieldValueAtThermocouples (volScalarField &field) |
Interpolates the field value at the thermocouples points. | |
void | differenceBetweenDirectAndMeasure () |
Computes the difference between direct problem solution and measures Saves the difference vector in Tdiff. | |
Foam::vector | cellDim (const faceList &ff, const pointField &pp, const cell &cc, labelList pLabels, pointField pLocal) |
Compute maximum cell dimension in x, y and z. | |
void | restart () |
Restart fields. | |
Public Member Functions inherited from laplacianProblem | |
laplacianProblem () | |
laplacianProblem (int argc, char *argv[]) | |
Construct with argc and argv. | |
~laplacianProblem () | |
void | truthSolve (List< scalar > mu_now, word folder="./ITHACAoutput/Offline/") |
Perform a truthsolve. | |
void | project (label Nmodes) |
Perform a projection onto the POD modes. | |
Public Member Functions inherited from reductionProblem | |
reductionProblem () | |
Construct Null. | |
~reductionProblem () | |
void | setParameters () |
Set Parameters Problems. | |
void | genRandPar () |
Generate Random Numbers. | |
void | genRandPar (label tsize) |
Generate Random Numbers given the dimension of the training set. | |
void | genEquiPar () |
Generate Equidistributed Numbers. | |
void | truthSolve () |
Perform a TruthSolve. | |
void | assignBC (volVectorField &s, label BC_ind, Vector< double > &value) |
Assign Boundary Condition to a volVectorField. | |
void | assignBC (volScalarField &s, label BC_ind, double &value) |
Assign Boundary Condition to a volScalarField. | |
void | reconstructFromMatrix (PtrList< volVectorField > &rec_field2, PtrList< volVectorField > &modes, label Nmodes, Eigen::MatrixXd coeff_matrix) |
Exact reconstruction using a certain number of modes for vector list of fields and the projection coefficients (volVectorField) | |
void | reconstructFromMatrix (PtrList< volScalarField > &rec_field2, PtrList< volScalarField > &modes, label Nmodes, Eigen::MatrixXd coeff_matrix) |
Exact reconstruction using a certain number of modes for vector list of fields and the projection coefficients (volScalarField) | |
template<typename T , typename G > | |
void | assignIF (T &s, G &value) |
Assign internal field condition. | |
template<typename T > | |
void | computeLift (T &Lfield, T &liftfield, T &omfield) |
Homogenize the snapshot matrix, it works with PtrList of volVectorField and volScalarField. | |
template<typename T > | |
void | computeLiftT (T &Lfield, T &liftfield, T &omfield) |
Virtual function to compute the lifting function. | |
void | liftSolve () |
Virtual function to compute the lifting function for scalar field. | |
void | liftSolveT () |
void | project () |
General projection operation. | |
void | writeMu (List< scalar > mu_now) |
Write out a list of scalar corresponding to the parameters used in the truthSolve. | |
std::vector< SPLINTER::RBFSpline > | getCoeffManifoldRBF (PtrList< volVectorField > snapshots, PtrList< volVectorField > &modes, word rbfBasis="GAUSSIAN") |
Constructs the parameters-coefficients manifold for vector fields, based on RBF-spline model. | |
std::vector< SPLINTER::RBFSpline > | getCoeffManifoldRBF (PtrList< volScalarField > snapshots, PtrList< volScalarField > &modes, word rbfBasis="GAUSSIAN") |
Constructs the parameters-coefficients manifold for scalar fields, based on RBF-spline model. | |
std::vector< SPLINTER::BSpline > | getCoeffManifoldSPL (PtrList< volVectorField > snapshots, PtrList< volVectorField > &modes, label splDeg=3) |
Constructs the parameters-coefficients manifold for vector fields, based on the B-spline model. | |
std::vector< SPLINTER::BSpline > | getCoeffManifoldSPL (PtrList< volScalarField > snapshots, PtrList< volScalarField > &modes, label splDeg=3) |
Constructs the parameters-coefficients manifold for scalar fields, based on the B-spline model. | |
Public Attributes | |
volScalarField & | T |
Temperature field. | |
fvMesh & | mesh |
Mesh. | |
Time & | runTime |
RunTime. | |
double | a |
Constant to define boundary conditions. | |
double | b |
Constant to define boundary conditions. | |
double | c |
Constant to define boundary conditions. | |
double | d |
Constant to define boundary conditions. | |
List< scalar > | heatFlux_gammaEx1 |
Boundary heat flux at the gammaEx1 patch. | |
List< scalar > | heatFlux_gammaEx2 |
Boundary heat flux at the gammaEx2 patch. | |
List< scalar > | heatFlux_gammaEx3 |
Boundary heat flux at the gammaEx3 patch. | |
List< scalar > | heatFlux_gammaEx4 |
Boundary heat flux at the gammaEx4 patch. | |
label | gammaEx1_ind |
gammaEx1 boundary patches label | |
label | gammaEx2_ind |
gammaEx2 boundary patches label | |
label | gammaEx3_ind |
gammaEx3 boundary patches label | |
label | gammaEx4_ind |
gammaEx4 boundary patches label | |
PtrList< volScalarField > | gField |
List of estimated heat fluxes used for post processing. | |
Public Attributes inherited from inverseLaplacianProblem_paramBC | |
word | folderOffline = "./ITHACAoutput/offlineParamBC/" |
Folder where the offline solutions and matrices are saved. | |
PtrList< volScalarField > | Tbasis |
Solutions of the direct problem with the basis of the parameterization as boundary heat flux. | |
PtrList< volScalarField > | Tad_base |
Solution of the additional problem. | |
Eigen::VectorXd | residual |
Residual of the linear system. | |
Eigen::MatrixXd | Theta |
Theta matrix of the lynear system. | |
Eigen::MatrixXd | gPODmodes |
Modes of the POD. | |
Eigen::VectorXd | addSol |
Solution of the additional problem at the thermocouples positions. | |
bool | offlineReady = 0 |
Flag to know if the offline phase was computed. | |
List< List< scalar > > | gBaseFunctions |
Basis of the heat flux parameterization. | |
List< scalar > | gWeights |
Weights of the heat flux parameterization. | |
double | shapeParameter |
RBF shape parameter. | |
word | baseFuncType |
Type of basis functions used for the parameterization of the heat flux. | |
Public Attributes inherited from inverseLaplacianProblem | |
ITHACAparameters * | para |
autoPtr< volScalarField > | _T |
Temperature field. | |
autoPtr< fvMesh > | _mesh |
Mesh. | |
autoPtr< simpleControl > | _simple |
simpleControl | |
autoPtr< fv::options > | _fvOptions |
fvOptions | |
autoPtr< Time > | _runTime |
Time. | |
dimensionedScalar | DT |
Dummy thermal conductivity with unitary value. | |
double | k |
Thermal diffusivity [W/(m K)]. | |
double | H |
Heat transfer coefficient [W/(m2 K)]. | |
bool | thermocouplesRead = 0 |
Flag to know if thermocouples file was read. | |
int | thermocouplesNum |
Number of thermocouples. | |
double | J |
Cost funtion [K^2]. | |
double | L2norm |
double | LinfNorm |
scalar | homogeneousBC = 0.0 |
Homogenerous BC. | |
List< scalar > | homogeneousBCcoldSide |
List of zeros of the size of coldSide patch. | |
List< scalar > | Tf |
Temperature at coldSide [K]. | |
List< scalar > | refGrad |
Reference gradient for the Robin BC. | |
List< scalar > | valueFraction |
Value fraction for the Robin BC. | |
label | hotSide_ind |
Index of the hotSide patch. | |
label | coldSide_ind |
Index of the coldSide patch. | |
List< scalar > | g |
Heat flux at hotSide [W/m2]. | |
List< List< scalar > > | gList |
List of boundary heat fluxes. | |
List< scalar > | gTrue |
True heat flux at hotSide [w/m2]. | |
List< scalar > | faceCellArea |
List of patch faces areas [m2]. | |
List< vector > | thermocouplesPos |
List containing the positions of the thermocouples. | |
List< int > | thermocouplesCellID |
List of cells indices containing a thermocouple. | |
List< int > | thermocouplesCellProc |
List of incedes of the processors contining each thermocouple. | |
Eigen::VectorXd | Tmeas |
Vector of measured temperatures at the thermocouples locations [K]. | |
Eigen::VectorXd | Tdirect |
Vector of computed temperatures at the thermocouples locations [K]. | |
Eigen::VectorXd | Tdiff |
Difference between computed and measured temperatures at the thermocouples. | |
label | nProcs |
Number of processors. | |
Public Attributes inherited from laplacianProblem | |
PtrList< volScalarField > | Tfield |
List of snapshots for the solution. | |
PtrList< volScalarField > | Tonline |
List of snapshots for the solution. | |
volScalarModes | Tmodes |
List of POD modes. | |
PtrList< fvScalarMatrix > | operator_list |
List of operators. | |
List< scalar > | theta |
Theta (coefficients of the affine expansion) | |
PtrList< volScalarField > | nu_list |
Nu (diffusivity) | |
label | NTmodes |
Number of modes reduced problem. | |
List< Eigen::MatrixXd > | A_matrices |
A matrices. | |
Eigen::MatrixXd | source |
Source vector. | |
autoPtr< volScalarField > | _T |
Temperature field. | |
autoPtr< volScalarField > | _S |
Source Term. | |
autoPtr< volScalarField > | _nu |
Diffusivity. | |
autoPtr< fvMesh > | _mesh |
Mesh. | |
autoPtr< Time > | _runTime |
Time. | |
Public Attributes inherited from reductionProblem | |
label | Pnumber |
Number of parameters. | |
label | Tnumber |
Dimension of the training set (used only when gerating parameters without input) | |
Eigen::MatrixXd | mu |
Row matrix of parameters. | |
Eigen::MatrixXd | mu_range |
Range of the parameter spaces. | |
Eigen::MatrixXd | mu_samples |
Matrix of parameters to be used for PODI, where each row corresponds to a sample point. In this matrix the time dimension is regarded as a parameter for unsteady problems. | |
double | mu_cur |
Current value of the parameter. | |
bool | podex |
Boolean variable, it is 1 if the POD has already been computed, else 0. | |
bool | offline |
Boolean variable, it is 1 if the Offline phase has already been computed, else 0. | |
IOdictionary * | ITHACAdict |
dictionary to store input output infos | |
autoPtr< argList > | _args |
argList | |
ITHACAparallel * | paral |
parallel handling | |
label | folderN = 1 |
Counter to save intermediate steps in the correct folder, for unsteady and some stationary cases. | |
label | counter = 1 |
Counter used for the output of the full order solutions. | |
Eigen::MatrixXi | inletIndex |
Matrix that contains informations about the inlet boundaries. | |
Eigen::MatrixXi | inletPatch |
Matrix that contains informations about the inlet boundaries without specifing the direction Rows = Number of parametrized boundary conditions Cols = 1 Example: example.inletIndex.resize(2, 1); example.inletIndex(0, 0) = 0; example.inletIndex(1, 0) = 1; Means that there are two parametrized boundary conditions of which the first row is of patch 0 and the second row of patch 1. | |
Eigen::MatrixXi | inletIndexT |
Class where the first inverse heat transfer problem tutorial is solved using the Parameterization of the heat flux.
It is a child of the inverseLaplacianProblem_paramBC class and some of its functions are overridden to be adapted to the specific case.
Definition at line 9 of file IHTP01inverseLaplacian.H.
|
inlineexplicit |
Definition at line 12 of file IHTP01inverseLaplacian.H.
|
inlinevirtual |
Assign the correct boundary condition to direct problem and assign -g/k to the hotSide patch.
Reimplemented from inverseLaplacianProblem.
Definition at line 157 of file IHTP01inverseLaplacian.H.
|
inline |
Compute the best approximation of the true heat flux gTrue in the parameterized space.
Definition at line 176 of file IHTP01inverseLaplacian.H.
|
inline |
Compute the best interpolation of the true heat flux gTrue in the parameterized space.
Definition at line 201 of file IHTP01inverseLaplacian.H.
|
inline |
Post process all the estimated heat fluxes heatFluxFieldName inside folder computing the relative error field with respect to gTrue with the related L2 and Linfty norms.
[in] | folder | Folder where the estimatied heat fluxes are read and the post processed results saved |
[in] | heatFluxFieldName | Name of the heat flux to post process |
[in] | innerField | Value of the output field in the interior of the domain (0 by default) |
Definition at line 148 of file IHTP01inverseLaplacian.H.
|
inlinevirtual |
Solve the additional problem.
Reimplemented from inverseLaplacianProblem_paramBC.
Definition at line 76 of file IHTP01inverseLaplacian.H.
|
inlinevirtual |
Perform a solution of the direct problem with the correct boundary conditions.
Reimplemented from inverseLaplacianProblem.
Definition at line 165 of file IHTP01inverseLaplacian.H.
double IHTP01inverseLaplacian_paramBC::a |
Constant to define boundary conditions.
Definition at line 34 of file IHTP01inverseLaplacian.H.
double IHTP01inverseLaplacian_paramBC::b |
Constant to define boundary conditions.
Definition at line 37 of file IHTP01inverseLaplacian.H.
double IHTP01inverseLaplacian_paramBC::c |
Constant to define boundary conditions.
Definition at line 40 of file IHTP01inverseLaplacian.H.
double IHTP01inverseLaplacian_paramBC::d |
Constant to define boundary conditions.
Definition at line 43 of file IHTP01inverseLaplacian.H.
label IHTP01inverseLaplacian_paramBC::gammaEx1_ind |
gammaEx1 boundary patches label
Definition at line 58 of file IHTP01inverseLaplacian.H.
label IHTP01inverseLaplacian_paramBC::gammaEx2_ind |
gammaEx2 boundary patches label
Definition at line 61 of file IHTP01inverseLaplacian.H.
label IHTP01inverseLaplacian_paramBC::gammaEx3_ind |
gammaEx3 boundary patches label
Definition at line 64 of file IHTP01inverseLaplacian.H.
label IHTP01inverseLaplacian_paramBC::gammaEx4_ind |
gammaEx4 boundary patches label
Definition at line 67 of file IHTP01inverseLaplacian.H.
PtrList<volScalarField> IHTP01inverseLaplacian_paramBC::gField |
List of estimated heat fluxes used for post processing.
Definition at line 70 of file IHTP01inverseLaplacian.H.
List<scalar> IHTP01inverseLaplacian_paramBC::heatFlux_gammaEx1 |
Boundary heat flux at the gammaEx1 patch.
Definition at line 46 of file IHTP01inverseLaplacian.H.
List<scalar> IHTP01inverseLaplacian_paramBC::heatFlux_gammaEx2 |
Boundary heat flux at the gammaEx2 patch.
Definition at line 49 of file IHTP01inverseLaplacian.H.
List<scalar> IHTP01inverseLaplacian_paramBC::heatFlux_gammaEx3 |
Boundary heat flux at the gammaEx3 patch.
Definition at line 52 of file IHTP01inverseLaplacian.H.
List<scalar> IHTP01inverseLaplacian_paramBC::heatFlux_gammaEx4 |
Boundary heat flux at the gammaEx4 patch.
Definition at line 55 of file IHTP01inverseLaplacian.H.
fvMesh& IHTP01inverseLaplacian_paramBC::mesh |
Mesh.
Definition at line 28 of file IHTP01inverseLaplacian.H.
Time& IHTP01inverseLaplacian_paramBC::runTime |
RunTime.
Definition at line 31 of file IHTP01inverseLaplacian.H.
volScalarField& IHTP01inverseLaplacian_paramBC::T |
Temperature field.
Definition at line 25 of file IHTP01inverseLaplacian.H.