|
[Sponsors] | |||||
Initalization of List<dimensionedScalar> with a proper dimensionSet |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
New Member
Maciej Marczak
Join Date: Sep 2020
Posts: 8
Rep Power: 7 ![]() |
Hi everyone,
I am developing a custom solver in which I need to load some values from the dictionary at the beginning of the simulation. I have a variable: Code:
List<dimensionedScalar> solidSpeciesMolarMass_; Code:
solidSpeciesMolarMass_(lookup("solidSpeciesMolarMass")),
Code:
--> FOAM FATAL ERROR:
Different dimensions for =
dimensions : [0 0 0 0 0 0 0] = [1 0 0 0 -1 0 0]
Code:
{
List<scalar> vals(lookup("solidSpeciesMolarMass"));
List<dimensionedScalar> mass;
forAll(vals, i)
{
mass.append
(
dimensionedScalar
(
Foam::name(i) + "_molarMass",
dimensionSet(1, 0, 0, 0, -1, 0, 0),
vals[i] * 1e-3
)
);
}
return mass;
}
Is there any way that I can build a list of dimensionedScalar in this automatic way? Thanks! |
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What is the best proper value of second per iteration? | dlalstnf | SU2 | 1 | April 6, 2023 13:54 |
| [mesh manipulation] The extracted patch Labels in not proper for different test case. | sunagra27 | OpenFOAM Meshing & Mesh Conversion | 0 | May 31, 2021 04:08 |
| how to get proper points location of geometry in CFD Post? | teguhtf | ANSYS | 0 | May 4, 2020 16:59 |
| Proper cores number to be used in CFX simulation | Anna Tian | CFX | 8 | March 10, 2015 05:07 |
| Constructing vector from three scalars | mayank.dce2k7 | OpenFOAM Running, Solving & CFD | 8 | January 28, 2014 17:07 |