This thesis first introduces topological defects in cosmology by explaining how they are formed by spontaneous symmetry breaking. Domain walls are then introduced in more detail, including a brief discussion of the domain wall problem in cosmology. The Standard Model (SM) of particle physics is then reviewed, with an explantation of the Higgs mechanism and the Goldstone bosons. After that, the shortcomings of the SM are briefly discussed, which pinpoint the necessity of physics beyond the SM. In particular, measurements of CP violation in particle physics are presented to motivate models beyond the SM such as supersymmetry. The Two Higgs Doublet Model (2HDM) is then introduced, with different parametrizations explained and masses of the physical scalars determined in terms of the parameters of the 2HDM. The remaining parts of the thesis rely on numerical simulations using the gradient flow technique. The theory of the technique is first introduced, before it is applied to the Z2-symmetric 2HDM. In most of our original results, the Higgs doublets are parametrized as an electroweak rotation of the charge-violating vacua. The equations of motion are derived for the vacuum parameters and the Goldstone bosons. The equations are then solved using gradient flow, with the results presented in different parametrizations of the Higgs doublets. Local charge violation is observed in the solutions when G2 is applied with asymmetric boundary conditions. CP-violating solutions are also seen for the Goldstone modes Î¸ and G3 respectively, when asymmetric boundary conditions are imposed.