|
[Sponsors] | |||||
|
|
|
#1 |
|
Member
UOCFD
Join Date: Oct 2020
Posts: 40
Rep Power: 7 ![]() |
How can time dependency be added inside the explicit term of the semiImplicitSource??
This is my attempt but it shows: ‘runTime’ was not declared in this scope mesh_.time().value() didn't work as well... Code:
energySource
{
type semiImplicitSource;
timeStart 0;
duration 0.025;
selectionMode cellSet;
cellSet ignitionCells;
volumeMode absolute;
sources
{
h
{
explicit
{
type coded;
name heatInjection;
code
#{
const scalar tiempo = runTime.value(); //mesh_.time().value();
const scalar power = 0;
const scalar tMax = 0.010;
const scalar Pmax = 4e5; //Pmax/Vapp
const scalar pCorte = 2.67e5; //2/3*Pmax;
const scalar tCorte = 0.015774; //(-2-pow(0.5,(4-8/3)))/(-2/tMax);
if (tiempo < tCorte)
{
power = ((-1/tMax)*pow(2,tiempo)+2*tiempo)/(tMax/Pmax);
}
else
{
power = (pow(2,tiempo)+pow(2,endTime)-2*tiempo*endTime)*pCorte/(pow(2,tCorte)+pow(2,endTime)-2*tCorte*endTime);
}
return power;
#};
}
implicit 0;
}
}
/*
|
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
|
const Time& tiempo = mesh().time();
See e.g. https://www.openfoam.com/documentati...ces-coded.html Saludos, Domenico. |
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| bash script for pseudo-parallel usage of reconstructPar | kwardle | OpenFOAM Post-Processing | 43 | October 28, 2025 04:19 |
| [solidMechanics] Support thread for "Solid Mechanics Solvers added to OpenFOAM Extend" | bigphil | OpenFOAM CC Toolkits for Fluid-Structure Interaction | 686 | December 22, 2022 10:10 |
| AMI speed performance | danny123 | OpenFOAM | 21 | October 24, 2020 05:13 |
| Star cd es-ice solver error | ernarasimman | STAR-CD | 2 | September 12, 2014 01:01 |
| Micro Scale Pore, icoFoam | gooya_kabir | OpenFOAM Running, Solving & CFD | 2 | November 2, 2013 14:58 |