OOFEM 3.0
Loading...
Searching...
No Matches
depositedheatsource.C
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
35#include "depositedheatsource.h"
36#include "timestep.h"
37#include "function.h"
38#include "classfactory.h"
39#include "material.h"
40#include "engngm.h"
41#include "field.h"
42
43namespace oofem {
45
46void DepositedHeatSource :: computeValueAt (FloatArray &answer, TimeStep *tStep, GaussPoint *gp, ValueModeType mode)
47{
48 answer.resize(1);
49
50 if (mode == VM_Total) {
51
52 double depositedMassFractionIncrement = this->domain->giveFunction(this->depositedMassFractionFunction)->evaluate(tStep, VM_Incremental);
53 if (depositedMassFractionIncrement > 0.0) {
54
55 Element* elem = gp->giveElement();
56 FloatArray nodaltemp;
57 elem->computeVectorOf({T_f}, VM_TotalIntrinsic, tStep, nodaltemp);
58 double temperature = nodaltemp.sum() / nodaltemp.size(); // average element value
59 double factor = 1.0; // this->giveTimeFunction()->evaluate(tStep, mode);
60 answer.at(1) = depositedMassFractionIncrement*this->powervalue*(this->depositionTemperature-temperature)/tStep->giveTimeIncrement(); // W/m3
61 answer.times(factor);
62 } else {
63 answer.zero();
64 }
65 } else {
66 OOFEM_ERROR("DepositedHeatSource::computeValueAt - unsupported ValueModeType %d\n", mode);
67 }
68
69}
70
71void DepositedHeatSource :: computeValueAt(FloatArray &answer, TimeStep *tStep, const FloatArray &coords, ValueModeType mode)
72{
73 answer.resize(1);
74
75 if (mode == VM_Total) {
76
77 double depositedMassFractionIncrement = this->domain->giveFunction(this->depositedMassFractionFunction)->evaluate(tStep, VM_Incremental);
78 if (depositedMassFractionIncrement > 0.0) {
79 FloatArray val(1);
80 //Material *mat = this->domain->giveMaterial(depositedMaterialID); // just to check material existence
81 //double rho = 3.0; //mat ? mat->give('d', nullptr) : 0.0;
82 //double specificHeat = 3.0; // mat ? mat->give('c', nullptr) : 0.0;
83 this->domain->giveEngngModel()->giveField(FT_Temperature, tStep)->evaluateAt(val, coords, mode, tStep);
84 double temperature = val.at(1);
85 // get massFraction Increment over the time step
86 double factor = 1.0; // this->giveTimeFunction()->evaluate(tStep, mode);
87 answer.at(1) = depositedMassFractionIncrement*this->powervalue*(this->depositionTemperature-temperature)/tStep->giveTimeIncrement(); // W/m3
88 answer.times(factor);
89 } else {
90 answer.zero();
91 }
92 } else {
93 OOFEM_ERROR("DepositedHeatSource::computeValueAt - unsupported ValueModeType %d\n", mode);
94 }
95}
96
105
106} // end namespace oofem
#define REGISTER_BoundaryCondition(class)
void initializeFrom(InputRecord &ir) override
double depositionTemperature
power = specificHeat * density
double powervalue
ID of the deposited material; not used at the moment.
int depositedMassFractionFunction
Temperature of the deposited material.
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Definition element.C:103
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition femcmpnn.h:79
Index size() const
Definition floatarray.h:162
void resize(Index s)
Definition floatarray.C:94
double & at(Index i)
Definition floatarray.h:202
double sum() const
Definition floatarray.C:874
void zero()
Zeroes all coefficients of receiver.
Definition floatarray.C:683
void times(double s)
Definition floatarray.C:834
Element * giveElement()
Returns corresponding element to receiver.
Definition gausspoint.h:187
void initializeFrom(InputRecord &ir) override
double giveTimeIncrement()
Returns solution step associated time increment.
Definition timestep.h:168
#define _IFT_DepositedHeatSource_depositedmaterialid
#define _IFT_DepositedHeatSource_depositedmassfractionfunction
#define _IFT_DepositedHeatSource_power
#define _IFT_DepositedHeatSource_depositiontemperature
#define OOFEM_ERROR(...)
Definition error.h:79
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011