|
[Sponsors] |
Updating a custom field using values from fvModels |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 3, 2024, 10:50 |
Updating a custom field using values from fvModels
|
#1 |
New Member
Marius
Join Date: Aug 2020
Location: Germany
Posts: 11
Rep Power: 6 |
Hello everyone,
I'm trying to update the values of a custom field I added to the multicomponentFluid solver in OpenFOAM 11. The field should only depend on the values from a fvModel and shouldn't be affected by the flow itself. Therefore I tried to extend the thermophysicalPredictor like this (copied from component fields Y_ and removed terms for transport): Code:
void Foam::solvers::electrochemFluid::thermophysicalPredictor() { tmp<fv::convectionScheme<scalar>> mvConvection( fv::convectionScheme<scalar>::New(mesh, fields, phi, mesh.schemes().div("div(phi,Yi_h)"))); reaction->correct(); volScalarField &myField = myField_; fvScalarMatrix myFieldEqn(fvm::ddt(myField) == fvModels().source(myField)); myFieldEqn.relax(); fvConstraints().constrain(myFieldEqn); myFieldEqn.solve("myField"); fvConstraints().constrain(myField); forAll(Y, i) { ... Code:
forAll(cells, i){eqn.source()[cells[i]] = 1.0;} Code:
internalField uniform 0; boundaryField { ".*" { type zeroGradient; } } Is there something obvious I missed? What could I try to resolve this issue? Thank you in advance for any help! |
|
Tags |
arithmetic exception, custom field, fvmodel, fvmodels |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Create non-uniform internal field values based on a graph or table | finn_amann | OpenFOAM Pre-Processing | 0 | June 28, 2023 09:20 |
getting cutplanes of a custom vector field (vorticity in my case) | zog | OpenFOAM Post-Processing | 0 | February 2, 2023 19:26 |
Can i take contours from Custom field function i defined ? | rahulohlan | FLUENT | 3 | April 18, 2017 14:39 |
Store data in a different field from a custom BC | cstuart | OpenFOAM Programming & Development | 0 | March 21, 2017 11:14 |
Setting patch field values equal to internal field values | leroyv | OpenFOAM Programming & Development | 1 | October 21, 2014 16:49 |