chombo-discharge
Loading...
Searching...
No Matches
CD_MFHelmholtzElectrostaticEBBCImplem.H
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021-2026 SINTEF Energy Research
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
13#ifndef CD_MFHELMHOLTZELECTROSTATICEBBCIMPLEM_H
14#define CD_MFHELMHOLTZELECTROSTATICEBBCIMPLEM_H
15
16// Std includes
17#include <limits>
18
19// Our includes
21#include <CD_NamespaceHeader.H>
22
23Real
25 const RealVect& a_pos) const // NOLINT(readability-convert-member-functions-to-static)
26{
27 CH_TIME("MFHelmholtzElectrostaticEBBC::getElectrodePotential(RealVect)");
28
29 // Find closest electrode
30 int closestElectrode = 0;
31 Real minDist = std::numeric_limits<Real>::infinity();
32
34
35 for (int i = 0; i < electrodeBCs.size(); i++) {
36 const RefCountedPtr<BaseIF>& impFunc = electrodeBCs[i].first.getImplicitFunction();
37
38 const Real curDist = std::abs(impFunc->value(a_pos));
39
40 if (curDist < minDist) {
43 }
44 }
45
46 // Return potential of closest electrode. Again, following the (perhaps odd) convention that the FieldSolver is "time dependent" but the operator
47 // factory is not, we've passed the time in by reference to the functions in m_electrostaticBCs. Calling those functions simply ignore the time-argument
48 // and uses FieldSolver::m_dt instead. So, we can just use a dummy dt here.
49 constexpr Real dummyDt = 0.0;
50
52}
53
54#include <CD_NamespaceFooter.H>
55
56#endif
Declaration of a Electrostatic boundary condition class for MFHelmholtzOp.
Real getElectrodePotential(const RealVect &a_pos) const
Get electrode potential.
Definition CD_MFHelmholtzElectrostaticEBBCImplem.H:24
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:38
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:26