Hi Lorenzo, you can do so by obtaining the global coordinates of your degree of freedom via the sub-control volume, e.g.:
const auto pos = fvGeometry.subContVol[scvIdx].global; pos is a container with the coordinates. Now you can define your own function depending on x and y by using pos[0] and pos[1]. I hope this helps! Best wishes, Dennis ________________________________ Von: Dumux <[email protected]> im Auftrag von lc <[email protected]> Gesendet: Freitag, 19. Oktober 2018 12:45:32 An: [email protected] Betreff: [DuMuX] initial value dependent on x and y domain coordinate Dear developers and users, thanks for your fast and appropriate. Once again I have a doubt. How can I apply an initial condition (for example on saturation profile) which depends on the x and y spatial coordinates of the domain? //! Evaluates the initial value for a control volume. For this //! method, the 'values' parameter stores primary variables. void initial(PrimaryVariables &values, const Element &element, const FVElementGeometry &fvGeometry, int scvIdx) const { values[Indices::pwIdx] =200 kPa = 2 bar values[Indices::snIdx] = should go here ... } Kind regards, Lorenzo
_______________________________________________ Dumux mailing list [email protected] https://listserv.uni-stuttgart.de/mailman/listinfo/dumux
